AWS Security ChangesHomeSearch

AWS code-library documentation change

Service: code-library · 2026-05-04 · Documentation low

File: code-library/latest/ug/bash_2_kafka_code_examples.md

Summary

Added resource tagging to MSK cluster creation, IAM policies, security groups, key pairs, and EC2 instances

Security assessment

Changes exclusively add organizational tags without modifying security configurations. Encryption settings remain unchanged. Tags aid operational management but don't mitigate vulnerabilities or document security features.

Diff

diff --git a/code-library/latest/ug/bash_2_kafka_code_examples.md b/code-library/latest/ug/bash_2_kafka_code_examples.md
index 19e99b613..2f91d918b 100644
--- a//code-library/latest/ug/bash_2_kafka_code_examples.md
+++ b//code-library/latest/ug/bash_2_kafka_code_examples.md
@@ -387 +387,2 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-        --encryption-info "{\"EncryptionInTransit\": {\"InCluster\": true, \"ClientBroker\": \"TLS\"}}" 2>&1)
+        --encryption-info "{\"EncryptionInTransit\": {\"InCluster\": true, \"ClientBroker\": \"TLS\"}}" \
+        --tags project=doc-smith,tutorial=amazon-managed-streaming-for-apache-kafka-gs 2>&1)
@@ -500,0 +502,3 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
+    aws iam tag-policy --policy-arn "$POLICY_ARN" \
+        --tags Key=project,Value=doc-smith Key=tutorial,Value=amazon-managed-streaming-for-apache-kafka-gs
+    
@@ -516,0 +521,2 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
+    aws iam tag-role --role-name "$ROLE_NAME" \
+        --tags Key=project,Value=doc-smith Key=tutorial,Value=amazon-managed-streaming-for-apache-kafka-gs
@@ -602 +608,2 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-        --vpc-id "$DEFAULT_VPC_ID" 2>&1)
+        --vpc-id "$DEFAULT_VPC_ID" \
+        --tag-specifications 'ResourceType=security-group,Tags=[{Key=project,Value=doc-smith},{Key=tutorial,Value=amazon-managed-streaming-for-apache-kafka-gs}]' 2>&1)
@@ -663 +670 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-    KEY_RESPONSE=$(aws ec2 create-key-pair --key-name "$KEY_NAME" --query 'KeyMaterial' --output text 2>&1)
+    KEY_RESPONSE=$(aws ec2 create-key-pair --key-name "$KEY_NAME" --tag-specifications 'ResourceType=key-pair,Tags=[{Key=project,Value=doc-smith},{Key=tutorial,Value=amazon-managed-streaming-for-apache-kafka-gs}]' --query 'KeyMaterial' --output text 2>&1)
@@ -703 +710 @@ 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=MSKTutorialClient-${RANDOM_SUFFIX}}]" 2>&1)
+        --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=MSKTutorialClient-${RANDOM_SUFFIX}},{Key=project,Value=doc-smith},{Key=tutorial,Value=amazon-managed-streaming-for-apache-kafka-gs}]" 2>&1)