TagSpecifications

0

Hi. I am trying to add tags when an SSM Automation script creates an AMI of an EC2 instance. How am I supposed to use the TagSpecifications input?

  • Hello. Can you give more context for this question? Are you using a custom document? What step are you creating the instance with (ex: aws:executeScript)? What API are you calling with the TagSpecifications input?

已提問 2 年前檢視次數 84 次
1 個回答
0

If you are planning to tag AMIs while using the CreateImage API with "aws:executeAwsApi" action in SSM Automation, then you can specify "TagSpecifications" as follows:

Sample:-

schemaVersion: '0.3'
parameters:
  instance:
    type: String
mainSteps:
  - name: CreateImage
    action: aws:executeAwsApi
    isEnd: true
    inputs:
      Service: ec2
      Api: CreateImage
      InstanceId: '{{ instance }}'
      Name: 'TestAMI'
      TagSpecifications:
        - ResourceType: image
          Tags:
            - Key: Name
              Value: SSM
AWS
支援工程師
Aamir_H
已回答 1 個月前

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

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

回答問題指南