How do I updated a CloudWatch Synthetics Canary layer version number using the AWS CLI?

0

Hello,

I created a CloudWatch Synthetics Canary via a console blueprint

I want to update the active layer version ("39" – bolded below) using the AWS CLI

I see it in the Code["SourceLocationArn"] attribute in my describe-canary response

The update-canary operation doesn't have a SourceLocationArn option for the --code value.

How do I updated the layer version number using the AWS CLI?

Thank you

        {
            "Id": "aae1dc97-773b-47bb-ae72-d0bb54eec60c",
            "Name": "daily-wisdom-texts",
            "Code": {
**                "SourceLocationArn": "arn:aws:lambda:us-east-1:875425895862:layer:cwsyn-daily-wisdom-texts-aae1dc97-773b-47bb-ae72-d0bb54eec60c:39",
**                "Handler": "pageLoadBlueprint.handler"
            },
            "ExecutionRoleArn": "arn:aws:iam::875425895862:role/service-role/CloudWatchSyntheticsRole-daily-wisdom-texts-cf9-de04b4eb2bb3",
            "Schedule": {
                "Expression": "rate(1 hour)",
                "DurationInSeconds": 0
            },
            "RunConfig": {
                "TimeoutInSeconds": 60,
                "MemoryInMB": 1000,
                "ActiveTracing": false
            },
            "SuccessRetentionPeriodInDays": 31,
            "FailureRetentionPeriodInDays": 31,
            "Status": {
                "State": "RUNNING",
                "StateReasonCode": "UPDATE_COMPLETE"
            },
            "Timeline": {
                "Created": 1641343713.153,
                "LastModified": 1652481443.745,
                "LastStarted": 1652481444.83,
                "LastStopped": 1641675597.0
            },
            "ArtifactS3Location": "cw-syn-results-875425895862-us-east-1/canary/us-east-1/daily-wisdom-texts-cf9-de04b4eb2bb3",
            "EngineArn": "arn:aws:lambda:us-east-1:875425895862:function:cwsyn-daily-wisdom-texts-aae1dc97-773b-47bb-ae72-d0bb54eec60c:57",
            "RuntimeVersion": "syn-python-selenium-1.0",
            "Tags": {
                "blueprint": "heartbeat"
            }
        }

1개 답변
0

The number at the end of SourceLocationArn is the version of the Lambda layer you are using. The number gets incremented when some parts of the Lambda function are updated. Therefore, you cannot update with update-canary operation.

Lambda codes are included in the layer. You can see the numbers of layers on Lambda console. Select as follows: CloudWatch -> Synthetics Canaries -> <select your canary> -> Configuration -> Canary script Script location <https>. (That leads to lambda layers page.)

shimo
답변함 2년 전

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

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

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

관련 콘텐츠