AWS::Synthetics::Canary Not Creating S3 Bucket in EU

0

In my CloudFormation template, I have defined a AWS::Synthetics::Canary resource and have successfully deployed to us-east-1 region. An S3 bucket with the following name was automatically created during deployment: **cw-syn-results-${accountID}-us-east-1 **

When I deploy to eu-central-1 region, CloudFormation fails with the following error:

Resource handler returned message: "Invalid request provided: ArtifactS3Location: The bucket does not exist. (Service: Synthetics, Status Code: 400, Request ID: *****, Extended Request ID: null)" (RequestToken: *****, HandlerErrorCode: InvalidRequest)

I'm trying to understand why the S3 bucket was not created in the EU region. My ArtifactS3Location property is set to !Sub s3://cw-syn-results-${AWS::AccountId}-${AWS::Region}/canary/${Environment}-myscript

rchan
asked 2 years ago745 views
1 Answer
1
Accepted Answer

The aforementioned error indicates that the bucket specified did not exist in the eu-central-1 region at the time of Canary creation. In an attempt to reproduce this issue, I deployed the solution here and the only change I made to the template was to replace the RuntimeVersion: syn-1.0 property with RuntimeVersion: syn-nodejs-puppeteer-3.0 per the Synthetics runtime versions here . The stack deployed successfully.

To fix this issue, confirm that the S3 bucket was indeed created successfully from the stack events before the creation of the canary. You could also consider using the below snippet to narrow down the issue;

      ArtifactS3Location:
        Fn::Join:
          - ''
          - - s3://
            - Ref: MyArtifactBucket

My suspicion is that the bucket name used in ArtifactS3Location did not resolve to an existing bucket.

For further troubleshooting, we would require details that are non-public information. Please open a support case with AWS using the following link

AWS
answered 2 years ago
  • This solution works. In your solution, you explicitly define a AWS::S3::Bucket resource with bucket name "cw-syn-results-${AWS::AccountId}-${AWS::Region}" and then reference it in your AWS::Synthetics::Canary resource.

    I was under the impression that if AWS::Synthetics::Canary resource is defined, an S3 bucket with the following name "cw-syn-results-accountID-region" is automatically created even without defining an S3 bucket resource. This was the case when I deployed in the US region.

    It's probably better to explicitly define the S3 bucket resource and then reference that resource in the Canary. I would have more control in the S3 bucket configurations instead of relying on the generated S3 bucket (and the fact that the automated creation of the S3 bucket was not guaranteed in my case for EU region).

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions