User Tools

Site Tools


aws:tags

This is an old revision of the document!


Table of Contents

Tags

CLI

response = iam_client.tag_role(
    RoleName='MyRole',
    Tags=[
           {
           'Key': 'Repo',
           'Value': 'MyRepo'
           },
           {
           'Key': 'CliCreated',
           'Value': 'true'
           },
         ]
)

Cloudformation

General structure

    Properties:
      Tags:
        - Key: "Tag1"
          Value: "TagValue"
        - Key: "CreatedBy"
          Value: "CloudFormation"

Set SSM parameter Store with Tag, with Tag data in Parameter section of Cloudformation:-

Parameters: 
  AccountNumber:
    Type: String
    Default: 1234
    Description: AccountNumber

  TagRepo:
    Type: String
    Default: MyRepo
    Description: My Own Repository  

    
Resources:
  AccountParameter:
    Type: AWS::SSM::Parameter
    Properties:
      Name: AccountNumber 
      Type: String
      Value: !Ref AccountNumber
      Tags:
        Repo: !Ref TagRepo
        CreatedBy: Cloudformation 

Tags for S3 Buckets:-

  LambdaS3Bucket:
    Type: 'AWS::S3::Bucket'
    Properties:
      BucketName: MyUniqueBucket
      Tags:
        - Key: Repo
          Value: !Ref TagRepo
        - Key: CreatedBy
          Value: Cloudformation  
          
           
      
      Tags:
      - Key: Repo
        Value: !Ref TagRepository
      - Key: CreatedBy
        Value: Cloudformation    
aws/tags.1768389723.txt.gz · Last modified: by andrew

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki