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
질문됨 3년 전868회 조회
1개 답변
1
수락된 답변

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
답변함 3년 전
profile picture
전문가
검토됨 3달 전
  • 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).

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠