actionECS

tag_resource

Tags the provided resource(s) with provided tags

Activity as code

Below are the details and signature of the activity Python module.

Typeaction
Modulechaosaws.ecs.actions
Nametag_resource
ReturnNone

Usage

JSON

{
  "name": "tag-resource",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosaws.ecs.actions",
    "func": "tag_resource",
    "arguments": {
      "tags": [],
      "resource_arn": ""
    }
  }
}

YAML

name: tag-resource
provider:
  arguments:
    resource_arn: ""
    tags: []
  func: tag_resource
  module: chaosaws.ecs.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
tagslistYesTagsList of tags to apply to the resource
resource_arnstringYesARNResource ARN to which to set tags to

For ECS resources, the long-form ARN must be used. See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-arn-timeline

Example

{
  "tags": [
    { "key": "MyTagKey", "value": "MyTagValue" },
    { "key": "MyOtherTagKey", "value": "MyOtherTagValue" }
  ],
  "resource_arn": "arn:aws:ecs:us-east-1:123456789012:cluster/name"
}

Signature

def tag_resource(tags: List[Dict[str, str]],
                 resource_arn: str,
                 configuration: Dict[str, Dict[str, str]] = None,
                 secrets: Dict[str, Dict[str, str]] = None):
    pass