AWS code-library documentation change
Summary
Added tagging for ECS resources including cluster, key pair, security group, IAM role, EC2 instances, and task definitions.
Security assessment
Changes only add resource tagging for organizational purposes (project/tutorial tags) without addressing vulnerabilities or security controls. Tagging improves resource management but doesn't directly mitigate security risks.
Diff
diff --git a/code-library/latest/ug/ssm_example_ecs_GettingStarted_018_section.md b/code-library/latest/ug/ssm_example_ecs_GettingStarted_018_section.md index 05e969def..4595f2e5c 100644 --- a//code-library/latest/ug/ssm_example_ecs_GettingStarted_018_section.md +++ b//code-library/latest/ug/ssm_example_ecs_GettingStarted_018_section.md @@ -52,0 +53,4 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + # Tags + PROJECT_TAG="doc-smith" + TUTORIAL_TAG="ecs-ec2" + @@ -242 +246 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - CLUSTER_ARN=$(aws ecs create-cluster --cluster-name "$CLUSTER_NAME" --query 'cluster.clusterArn' --output text) + CLUSTER_ARN=$(aws ecs create-cluster --cluster-name "$CLUSTER_NAME" --tags key=project,value=$PROJECT_TAG key=tutorial,value=$TUTORIAL_TAG --query 'cluster.clusterArn' --output text) @@ -264,0 +269,2 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + + aws ec2 create-tags --resources "$KEY_PAIR_NAME" --tags Key=project,Value=$PROJECT_TAG Key=tutorial,Value=$TUTORIAL_TAG 2>>"$LOG_FILE" || log "WARNING: Failed to tag key pair" @@ -274,0 +281 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + --tag-specifications "ResourceType=security-group,Tags=[{Key=project,Value=$PROJECT_TAG},{Key=tutorial,Value=$TUTORIAL_TAG}]" \ @@ -346,0 +354,2 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + aws iam tag-role --role-name ecsInstanceRole --tags Key=project,Value=$PROJECT_TAG Key=tutorial,Value=$TUTORIAL_TAG + @@ -398 +407 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=ecs-tutorial-instance}]" \ + --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=ecs-tutorial-instance},{Key=project,Value=$PROJECT_TAG},{Key=tutorial,Value=$TUTORIAL_TAG}]" \ @@ -476 +485,11 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - "networkMode": "bridge" + "networkMode": "bridge", + "tags": [ + { + "key": "project", + "value": "PROJECT_TAG_PLACEHOLDER" + }, + { + "key": "tutorial", + "value": "TUTORIAL_TAG_PLACEHOLDER" + } + ] @@ -482,0 +502,2 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + sed -i "s|PROJECT_TAG_PLACEHOLDER|$PROJECT_TAG|g" task-definition.json + sed -i "s|TUTORIAL_TAG_PLACEHOLDER|$TUTORIAL_TAG|g" task-definition.json @@ -516,0 +538 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + --tags key=project,value=$PROJECT_TAG key=tutorial,value=$TUTORIAL_TAG \