Create Synthetics Canary from the command line as defined by the AWS console wizard

0

Accordying to https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Create.html , the AWS console wizard creates:

  • An IAM role with the name CloudWatchSyntheticsRole-canary-name-uuid (if you use CloudWatch console to create the canary and specify for a new role to be created for the canary)
  • An IAM policy with the name CloudWatchSyntheticsPolicy-canary-name-uuid.
  • An S3 bucket with the name cw-syn-results-accountID-region.
  • Alarms with the name Synthetics-Alarm-MyCanaryName, if you want alarms to be created for the canary.
  • Lambda functions and layers, if you use a blueprint to create the canary. These resources have the prefix cwsyn-MyCanaryName.
  • CloudWatch Logs log groups with the name /aws/lambda/cwsyn-MyCanaryName-randomId

How can I export the required aws-cli commands the AWS console uses to generate such alerts?, I'm specially interested in the uuid generation and lambda function / layer sections.

已提問 5 個月前檢視次數 450 次
1 個回答
0

There is no direct method to create CLI commands for actions done on the console. You can find all the CLI commands to create such resources yourself on AWS CLI documentation.

  • For example, Lambda functions and layers - You need to follow the create-function command. And for the uuid inside the name field, you will have to generate one using any custom script.
  • For example, CloudWatch Logs log groups, you need to follow put-log-group

Please note that part of this process is managed by AWS internally as well. If you want to get any additional assistance on any specific problem, please do reach out via a case on AWS Support.

profile pictureAWS
支援工程師
已回答 5 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南