Skip to content

Twoliter pubsys should be able to tag AMIs after publish/copy #574

@isaac-400

Description

@isaac-400

Some customers store additional image metadata in EC2 tags. Currently, the only way to update these tags is to replicate the behavior of the pubsys by assuming a role and calling EC2 CreateTags directly via scripts. The proposal here is to upstream this into the pubsys.

Customers could specify tags in Infra.toml per region or globally:

[aws]
regions = ["us-east-1", "us-west-2"]
tags = { storage-amount = 30}

[aws.regions.east-1.tags]
my-key = "my-value"

[aws.regions.us-west-2.tags]
WestCoast = "best coast!"
kernel-version = 6.1

Or they could specify tags when calling cargo make ami via the PUBLISH_AMI_TAGS environment variable:

cargo make -e PUBLISH_AMI_TAGS='[{"Key":"storage-amount","Value":30},{"Key":"WestCoast","Value":"best coast!"},{"Key":"kernel-version","Value":6.1}]' \
ami

Would produce EC2 tags like:

us-east-1 AMI

[
    {
        "Key": "storage-amount",
        "Value": 30
    },
    {
        "Key": "my-key",
        "Value": "my-value"
    }
]

us-west-2 AMI

[
  {
    "Key": "storage-amount",
    "Value": 30
  },
  {
    "Key": "WestCoast",
    "Value": "best coast!"
  },
  {
    "Key": "kernel-version",
    "Value": 6.1
  }
]

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions