Skip to content

Commit

Permalink
hashicorp#26486 Disable code signing in lambda for me-central-1
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerc committed Aug 25, 2022
1 parent e120465 commit c4fbecc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/26486.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_lambda_function: Prevent errors when attempting to configure code signing in the `me-central-1` AWS Region
```
6 changes: 3 additions & 3 deletions internal/service/lambda/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,12 +893,12 @@ func resourceFunctionRead(d *schema.ResourceData, meta interface{}) error {
return nil
}

// Currently, this functionality is not enabled in ap-northeast-3 (Osaka) and ap-southeast-3 (Jakarta) region
// and returns ambiguous error codes (e.g. AccessDeniedException)
// Currently, this functionality is not enabled in ap-northeast-3 (Osaka), ap-southeast-3 (Jakarta) and
// me-central-1 (UAE) region and returns ambiguous error codes (e.g. AccessDeniedException)
// so we cannot just ignore the error as would typically.
// We are hardcoding the region here, because go aws sdk endpoints
// package does not support Signer service
if region := meta.(*conns.AWSClient).Region; region == endpoints.ApNortheast3RegionID || region == endpoints.ApSoutheast3RegionID {
if region := meta.(*conns.AWSClient).Region; region == endpoints.ApNortheast3RegionID || region == endpoints.ApSoutheast3RegionID || region == endpoints.MeCentral1RegionID {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/service/lambda/function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func TestAccLambdaFunction_codeSigning(t *testing.T) {

// We are hardcoding the region here, because go aws sdk endpoints
// package does not support Signer service
for _, want := range []string{endpoints.ApNortheast3RegionID, endpoints.ApSoutheast3RegionID} {
for _, want := range []string{endpoints.ApNortheast3RegionID, endpoints.ApSoutheast3RegionID, endpoints.MeCentral1RegionID} {
if got := acctest.Region(); got == want {
t.Skipf("Lambda code signing config is not supported in %s region", got)
}
Expand Down

0 comments on commit c4fbecc

Please sign in to comment.