Skip to content

Commit

Permalink
provider: Followup items from initial Code Signing release
Browse files Browse the repository at this point in the history
Reference: #16383 (review)
Reference: #16384 (review)
Reference: #16398

Changes:

```
* data-source/aws_lambda_function: Prevent Lambda GetFunctionCodeSigningConfig API call error outside AWS Commercial regions
* resource/aws_lambda_function: Prevent Lambda GetFunctionCodeSigningConfig API call error outside AWS Commercial regions
```

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSLambdaFunction_basic (660.06s)
--- PASS: TestAccAWSLambdaFunction_codeSigningConfig (1207.31s)
--- PASS: TestAccAWSLambdaFunction_concurrency (1032.30s)
--- PASS: TestAccAWSLambdaFunction_concurrencyCycle (1057.54s)
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfig (132.39s)
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfigUpdated (138.81s)
--- PASS: TestAccAWSLambdaFunction_disablePublish (88.73s)
--- PASS: TestAccAWSLambdaFunction_disappears (1220.09s)
--- PASS: TestAccAWSLambdaFunction_EmptyVpcConfig (86.77s)
--- PASS: TestAccAWSLambdaFunction_enablePublish (129.99s)
--- PASS: TestAccAWSLambdaFunction_encryptedEnvVariables (145.89s)
--- PASS: TestAccAWSLambdaFunction_envVariables (718.17s)
--- PASS: TestAccAWSLambdaFunction_expectFilenameAndS3Attributes (14.86s)
--- PASS: TestAccAWSLambdaFunction_KmsKeyArn_NoEnvironmentVariables (1370.29s)
--- PASS: TestAccAWSLambdaFunction_Layers (1016.49s)
--- PASS: TestAccAWSLambdaFunction_LayersUpdate (160.26s)
--- PASS: TestAccAWSLambdaFunction_localUpdate (505.56s)
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (503.80s)
--- PASS: TestAccAWSLambdaFunction_nilDeadLetterConfig (48.16s)
--- PASS: TestAccAWSLambdaFunction_runtimes (1695.07s)
--- PASS: TestAccAWSLambdaFunction_s3 (40.08s)
--- PASS: TestAccAWSLambdaFunction_s3Update_basic (64.03s)
--- PASS: TestAccAWSLambdaFunction_s3Update_unversioned (64.88s)
--- PASS: TestAccAWSLambdaFunction_tags (1238.40s)
--- PASS: TestAccAWSLambdaFunction_tracingConfig (89.38s)
--- PASS: TestAccAWSLambdaFunction_UnpublishedCodeUpdate (737.76s)
--- PASS: TestAccAWSLambdaFunction_versioned (101.60s)
--- PASS: TestAccAWSLambdaFunction_versionedUpdate (1113.10s)
--- PASS: TestAccAWSLambdaFunction_VPC (1412.53s)
--- PASS: TestAccAWSLambdaFunction_VPC_withInvocation (989.01s)
--- PASS: TestAccAWSLambdaFunction_VpcConfig_ProperIamDependencies (623.72s)
--- PASS: TestAccAWSLambdaFunction_VPCRemoval (1977.57s)
--- PASS: TestAccDataSourceAWSLambdaFunction_alias (1211.85s)
--- PASS: TestAccDataSourceAWSLambdaFunction_basic (54.11s)
--- PASS: TestAccDataSourceAWSLambdaFunction_environment (1182.31s)
--- PASS: TestAccDataSourceAWSLambdaFunction_fileSystemConfig (1941.83s)
--- PASS: TestAccDataSourceAWSLambdaFunction_layers (1106.50s)
--- PASS: TestAccDataSourceAWSLambdaFunction_version (966.75s)
--- PASS: TestAccDataSourceAWSLambdaFunction_vpc (1697.94s)

--- PASS: TestAccAWSSignerSigningJob_basic (35.73s)

--- PASS: TestAccAWSSignerSigningProfile_basic (18.48s)
--- PASS: TestAccAWSSignerSigningProfile_GenerateName (18.16s)
--- PASS: TestAccAWSSignerSigningProfile_GenerateNameWithNamePrefix (18.17s)
--- PASS: TestAccAWSSignerSigningProfile_SignatureValidityPeriod (25.69s)
--- PASS: TestAccAWSSignerSigningProfile_tags (30.83s)

--- PASS: TestAccAWSSignerSigningProfilePermission_basic (23.93s)
--- PASS: TestAccAWSSignerSigningProfilePermission_GetSigningProfile (39.86s)
--- PASS: TestAccAWSSignerSigningProfilePermission_StartSigningJob_GetSP (25.33s)
--- PASS: TestAccAWSSignerSigningProfilePermission_StatementPrefix (28.76s)

--- PASS: TestAccDataSourceAWSSignerSigningJob_basic (30.06s)

--- PASS: TestAccDataSourceAWSSignerSigningProfile_basic (12.39s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSLambdaFunction_basic (60.15s)
--- PASS: TestAccAWSLambdaFunction_concurrency (86.67s)
--- PASS: TestAccAWSLambdaFunction_concurrencyCycle (138.48s)
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfig (152.23s)
--- PASS: TestAccAWSLambdaFunction_DeadLetterConfigUpdated (138.97s)
--- PASS: TestAccAWSLambdaFunction_disablePublish (72.75s)
--- PASS: TestAccAWSLambdaFunction_disappears (104.35s)
--- PASS: TestAccAWSLambdaFunction_EmptyVpcConfig (918.89s)
--- PASS: TestAccAWSLambdaFunction_enablePublish (111.27s)
--- PASS: TestAccAWSLambdaFunction_encryptedEnvVariables (156.43s)
--- PASS: TestAccAWSLambdaFunction_envVariables (168.64s)
--- PASS: TestAccAWSLambdaFunction_expectFilenameAndS3Attributes (25.56s)
--- PASS: TestAccAWSLambdaFunction_FileSystemConfig (1546.53s)
--- PASS: TestAccAWSLambdaFunction_KmsKeyArn_NoEnvironmentVariables (891.68s)
--- PASS: TestAccAWSLambdaFunction_Layers (916.74s)
--- PASS: TestAccAWSLambdaFunction_LayersUpdate (401.14s)
--- PASS: TestAccAWSLambdaFunction_localUpdate (1074.54s)
--- PASS: TestAccAWSLambdaFunction_localUpdate_nameOnly (1062.94s)
--- PASS: TestAccAWSLambdaFunction_nilDeadLetterConfig (888.61s)
--- PASS: TestAccAWSLambdaFunction_runtimes (1187.08s)
--- PASS: TestAccAWSLambdaFunction_s3 (35.88s)
--- PASS: TestAccAWSLambdaFunction_s3Update_basic (64.64s)
--- PASS: TestAccAWSLambdaFunction_s3Update_unversioned (62.12s)
--- PASS: TestAccAWSLambdaFunction_tags (859.06s)
--- PASS: TestAccAWSLambdaFunction_UnpublishedCodeUpdate (541.36s)
--- PASS: TestAccAWSLambdaFunction_versioned (148.92s)
--- PASS: TestAccAWSLambdaFunction_versionedUpdate (692.93s)
--- PASS: TestAccAWSLambdaFunction_VPC (1181.39s)
--- PASS: TestAccAWSLambdaFunction_VPC_withInvocation (703.33s)
--- PASS: TestAccAWSLambdaFunction_VpcConfig_ProperIamDependencies (455.69s)
--- PASS: TestAccAWSLambdaFunction_VPCRemoval (994.78s)
--- PASS: TestAccAWSLambdaFunction_VPCUpdate (1224.48s)
--- SKIP: TestAccAWSLambdaFunction_codeSigningConfig (2.22s)

--- SKIP: TestAccAWSSignerSigningJob_basic (7.57s)

--- SKIP: TestAccAWSSignerSigningProfile_basic (7.52s)
--- SKIP: TestAccAWSSignerSigningProfile_GenerateName (7.44s)
--- SKIP: TestAccAWSSignerSigningProfile_GenerateNameWithNamePrefix (1.85s)
--- SKIP: TestAccAWSSignerSigningProfile_SignatureValidityPeriod (7.35s)
--- SKIP: TestAccAWSSignerSigningProfile_tags (7.87s)

--- SKIP: TestAccAWSSignerSigningProfilePermission_basic (7.66s)
--- SKIP: TestAccAWSSignerSigningProfilePermission_GetSigningProfile (7.65s)
--- SKIP: TestAccAWSSignerSigningProfilePermission_StartSigningJob_GetSP (1.84s)
--- SKIP: TestAccAWSSignerSigningProfilePermission_StatementPrefix (1.86s)

--- PASS: TestAccDataSourceAWSLambdaFunction_alias (42.58s)
--- PASS: TestAccDataSourceAWSLambdaFunction_basic (34.49s)
--- PASS: TestAccDataSourceAWSLambdaFunction_environment (113.95s)
--- PASS: TestAccDataSourceAWSLambdaFunction_fileSystemConfig (961.20s)
--- PASS: TestAccDataSourceAWSLambdaFunction_layers (136.12s)
--- PASS: TestAccDataSourceAWSLambdaFunction_version (248.84s)
--- PASS: TestAccDataSourceAWSLambdaFunction_vpc (598.98s)

--- SKIP: TestAccDataSourceAWSSignerSigningJob_basic (7.44s)

--- SKIP: TestAccDataSourceAWSSignerSigningProfile_basic (7.37s)
```
  • Loading branch information
bflad committed Nov 24, 2020
1 parent c579584 commit 919b888
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 98 deletions.
10 changes: 10 additions & 0 deletions aws/data_source_aws_lambda_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/service/lambda"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
Expand Down Expand Up @@ -303,6 +304,15 @@ func dataSourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) e
return fmt.Errorf("error setting file_system_config: %s", err)
}

// Currently, this functionality is only enabled in AWS Commercial partition
// and other partitions return ambiguous error codes (e.g. AccessDeniedException
// in AWS GovCloud (US)) so we cannot just ignore the error as would typically.
if meta.(*AWSClient).partition != endpoints.AwsPartitionID {
d.SetId(aws.StringValue(function.FunctionName))

return nil
}

// Get Code Signing Config Output
// If code signing config output exists, set it to that value, otherwise set it empty.
codeSigningConfigInput := &lambda.GetFunctionCodeSigningConfigInput{
Expand Down
44 changes: 22 additions & 22 deletions aws/data_source_aws_signer_signing_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ import (
)

func TestAccDataSourceAWSSignerSigningJob_basic(t *testing.T) {
rString := acctest.RandString(48)
profileName := fmt.Sprintf("tf_acc_sp_basic_%s", rString)
rName := acctest.RandomWithPrefix("tf-acc-test")
dataSourceName := "data.aws_signer_signing_job.test"
resourceName := "aws_signer_signing_job.job_test"
resourceName := "aws_signer_signing_job.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccDataSourceAWSSignerSigningJobConfigBasic(profileName),
Config: testAccDataSourceAWSSignerSigningJobConfigBasic(rName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrPair(dataSourceName, "status", resourceName, "status"),
resource.TestCheckResourceAttrPair(dataSourceName, "job_owner", resourceName, "job_owner"),
Expand All @@ -31,17 +30,17 @@ func TestAccDataSourceAWSSignerSigningJob_basic(t *testing.T) {
})
}

func testAccDataSourceAWSSignerSigningJobConfigBasic(profileName string) string {
func testAccDataSourceAWSSignerSigningJobConfigBasic(rName string) string {
return fmt.Sprintf(`
data "aws_caller_identity" "current" {}
resource "aws_signer_signing_profile" "test_sp" {
resource "aws_signer_signing_profile" "test" {
platform_id = "AWSLambda-SHA384-ECDSA"
name = "%s"
name = replace(%[1]q, "-", "_")
}
resource "aws_s3_bucket" "bucket" {
bucket = "tf-signer-signing-bucket"
resource "aws_s3_bucket" "source" {
bucket = "%[1]s-source"
versioning {
enabled = true
Expand All @@ -50,36 +49,37 @@ resource "aws_s3_bucket" "bucket" {
force_destroy = true
}
resource "aws_s3_bucket" "dest_bucket" {
bucket = "tf-signer-signing-dest-bucket"
resource "aws_s3_bucket" "destination" {
bucket = "%[1]s-destination"
force_destroy = true
}
resource "aws_s3_bucket_object" "lambda_signing_code" {
bucket = aws_s3_bucket.bucket.bucket
resource "aws_s3_bucket_object" "source" {
bucket = aws_s3_bucket.source.bucket
key = "lambdatest.zip"
source = "test-fixtures/lambdatest.zip"
}
resource "aws_signer_signing_job" "job_test" {
profile_name = aws_signer_signing_profile.test_sp.name
resource "aws_signer_signing_job" "test" {
profile_name = aws_signer_signing_profile.test.name
source {
s3 {
bucket = aws_s3_bucket.bucket.bucket
key = aws_s3_bucket_object.lambda_signing_code.key
version = aws_s3_bucket_object.lambda_signing_code.version_id
bucket = aws_s3_bucket_object.source.bucket
key = aws_s3_bucket_object.source.key
version = aws_s3_bucket_object.source.version_id
}
}
destination {
s3 {
bucket = aws_s3_bucket.dest_bucket.bucket
bucket = aws_s3_bucket.destination.bucket
}
}
}
data "aws_signer_signing_job" "test" {
job_id = aws_signer_signing_job.job_test.job_id
}`, profileName)
job_id = aws_signer_signing_job.test.job_id
}
`, rName)
}
2 changes: 1 addition & 1 deletion aws/data_source_aws_signer_signing_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestAccDataSourceAWSSignerSigningProfile_basic(t *testing.T) {
profileName := fmt.Sprintf("tf_acc_sp_basic_%s", rString)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand Down
10 changes: 8 additions & 2 deletions aws/resource_aws_lambda_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/service/lambda"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down Expand Up @@ -711,8 +712,13 @@ func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) err
invokeArn := lambdaFunctionInvokeArn(*function.FunctionArn, meta)
d.Set("invoke_arn", invokeArn)

// Get Code Signing Config Output
// If code signing config output exists, set it to that value, otherwise set it empty.
// Currently, this functionality is only enabled in AWS Commercial partition
// and other partitions return ambiguous error codes (e.g. AccessDeniedException
// in AWS GovCloud (US)) so we cannot just ignore the error as would typically.
if meta.(*AWSClient).partition != endpoints.AwsPartitionID {
return nil
}

codeSigningConfigInput := &lambda.GetFunctionCodeSigningConfigInput{
FunctionName: aws.String(d.Get("function_name").(string)),
}
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_lambda_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func TestAccAWSLambdaFunction_codeSigningConfig(t *testing.T) {
cscUpdateResourceName := "aws_lambda_code_signing_config.code_signing_config_2"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") },
Providers: testAccProviders,
CheckDestroy: testAccCheckLambdaFunctionDestroy,
Steps: []resource.TestStep{
Expand Down
46 changes: 23 additions & 23 deletions aws/resource_aws_signer_signing_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ import (
)

func TestAccAWSSignerSigningJob_basic(t *testing.T) {
resourceName := "aws_signer_signing_job.test_job"
profileResourceName := "aws_signer_signing_profile.test_sp"
rString := acctest.RandString(48)
profileName := fmt.Sprintf("tf_acc_sp_basic_%s", rString)
rName := acctest.RandomWithPrefix("tf-acc-test")
resourceName := "aws_signer_signing_job.test"
profileResourceName := "aws_signer_signing_profile.test"

var job signer.DescribeSigningJobOutput
var conf signer.GetSigningProfileOutput

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") },
Providers: testAccProviders,
CheckDestroy: nil,
Steps: []resource.TestStep{
{
Config: testAccAWSSignerSigningJobConfig(profileName),
Config: testAccAWSSignerSigningJobConfig(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSignerSigningProfileExists(profileResourceName, profileName, &conf),
testAccCheckAWSSignerSigningProfileExists(profileResourceName, &conf),
testAccCheckAWSSignerSigningJobExists(resourceName, &job),
resource.TestCheckResourceAttr(resourceName, "platform_id", "AWSLambda-SHA384-ECDSA"),
resource.TestCheckResourceAttr(resourceName, "platform_display_name", "AWS Lambda"),
Expand All @@ -40,17 +39,17 @@ func TestAccAWSSignerSigningJob_basic(t *testing.T) {

}

func testAccAWSSignerSigningJobConfig(profileName string) string {
func testAccAWSSignerSigningJobConfig(rName string) string {
return fmt.Sprintf(`
data "aws_caller_identity" "current" {}
resource "aws_signer_signing_profile" "test_sp" {
resource "aws_signer_signing_profile" "test" {
platform_id = "AWSLambda-SHA384-ECDSA"
name = "%s"
name = replace(%[1]q, "-", "_")
}
resource "aws_s3_bucket" "bucket" {
bucket = "tf-signer-signing-bucket"
resource "aws_s3_bucket" "source" {
bucket = "%[1]s-source"
versioning {
enabled = true
Expand All @@ -59,34 +58,35 @@ resource "aws_s3_bucket" "bucket" {
force_destroy = true
}
resource "aws_s3_bucket" "dest_bucket" {
bucket = "tf-signer-signing-dest-bucket"
resource "aws_s3_bucket" "destination" {
bucket = "%[1]s"
force_destroy = true
}
resource "aws_s3_bucket_object" "lambda_signing_code" {
bucket = aws_s3_bucket.bucket.bucket
resource "aws_s3_bucket_object" "source" {
bucket = aws_s3_bucket.source.bucket
key = "lambdatest.zip"
source = "test-fixtures/lambdatest.zip"
}
resource "aws_signer_signing_job" "test_job" {
profile_name = aws_signer_signing_profile.test_sp.name
resource "aws_signer_signing_job" "test" {
profile_name = aws_signer_signing_profile.test.name
source {
s3 {
bucket = aws_s3_bucket.bucket.bucket
key = aws_s3_bucket_object.lambda_signing_code.key
version = aws_s3_bucket_object.lambda_signing_code.version_id
bucket = aws_s3_bucket_object.source.bucket
key = aws_s3_bucket_object.source.key
version = aws_s3_bucket_object.source.version_id
}
}
destination {
s3 {
bucket = aws_s3_bucket.dest_bucket.bucket
bucket = aws_s3_bucket.destination.bucket
}
}
}`, profileName)
}
`, rName)
}

func testAccCheckAWSSignerSigningJobExists(res string, job *signer.DescribeSigningJobOutput) resource.TestCheckFunc {
Expand Down
16 changes: 8 additions & 8 deletions aws/resource_aws_signer_signing_profile_permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ func TestAccAWSSignerSigningProfilePermission_basic(t *testing.T) {
var sppconf signer.ListProfilePermissionsOutput

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSignerSigningProfilePermissionConfig(profileName),
Destroy: false,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSignerSigningProfileExists(profileResourceName, profileName, &conf),
testAccCheckAWSSignerSigningProfileExists(profileResourceName, &conf),
testAccCheckAWSSignerSigningProfilePermissionExists(resourceName, profileName, &sppconf),
naming.TestCheckResourceAttrNameGenerated(resourceName, "statement_id"),
),
Expand All @@ -55,15 +55,15 @@ func TestAccAWSSignerSigningProfilePermission_GetSigningProfile(t *testing.T) {
var sppconf signer.ListProfilePermissionsOutput

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSignerSigningProfilePermissionGetSP(profileName),
Destroy: false,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSignerSigningProfileExists(profileResourceName, profileName, &conf),
testAccCheckAWSSignerSigningProfileExists(profileResourceName, &conf),
testAccCheckAWSSignerSigningProfilePermissionExists(resourceName, profileName, &sppconf),
),
},
Expand All @@ -77,7 +77,7 @@ func TestAccAWSSignerSigningProfilePermission_GetSigningProfile(t *testing.T) {
Config: testAccAWSSignerSigningProfilePermissionRevokeSignature(profileName),
Destroy: false,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSignerSigningProfileExists(profileResourceName, profileName, &conf),
testAccCheckAWSSignerSigningProfileExists(profileResourceName, &conf),
testAccCheckAWSSignerSigningProfilePermissionExists(resourceName, profileName, &sppconf),
),
},
Expand All @@ -96,14 +96,14 @@ func TestAccAWSSignerSigningProfilePermission_StartSigningJob_GetSP(t *testing.T
var sppconf signer.ListProfilePermissionsOutput

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSignerSigningProfilePermissionStartSigningJobGetSP(profileName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSignerSigningProfileExists(profileResourceName, profileName, &conf),
testAccCheckAWSSignerSigningProfileExists(profileResourceName, &conf),
testAccCheckAWSSignerSigningProfilePermissionExists(resourceName1, profileName, &sppconf),
testAccCheckAWSSignerSigningProfilePermissionExists(resourceName2, profileName, &sppconf),
),
Expand All @@ -129,7 +129,7 @@ func TestAccAWSSignerSigningProfilePermission_StatementPrefix(t *testing.T) {
var sppconf signer.ListProfilePermissionsOutput

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy,
Steps: []resource.TestStep{
Expand Down
Loading

0 comments on commit 919b888

Please sign in to comment.