AWS code-library documentation change
Summary
Added resource tagging to AWS Cloud Map, DynamoDB, Lambda, ECS, and IAM resource creation commands throughout the tutorial
Security assessment
Changes exclusively add tags (Key=project,Value=doc-smith and Key=tutorial,Value=...) to various resources. Tagging supports resource organization and cost allocation but doesn't address vulnerabilities, security features, or security documentation. No security-related context or vulnerability fixes are present.
Diff
diff --git a/code-library/latest/ug/bash_2_servicediscovery_code_examples.md b/code-library/latest/ug/bash_2_servicediscovery_code_examples.md index fde3c9929..dac68edf1 100644 --- a//code-library/latest/ug/bash_2_servicediscovery_code_examples.md +++ b//code-library/latest/ug/bash_2_servicediscovery_code_examples.md @@ -237 +237 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - OPERATION_ID=$(aws servicediscovery create-http-namespace --name cloudmap-tutorial --creator-request-id "namespace-request-$(date +%s)" --query 'OperationId' --output text) + OPERATION_ID=$(aws servicediscovery create-http-namespace --name cloudmap-tutorial --creator-request-id "namespace-request-$(date +%s)" --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-custom-attributes --query 'OperationId' --output text) @@ -259 +259 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - log_cmd "aws dynamodb create-table --table-name cloudmap --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST" + log_cmd "aws dynamodb create-table --table-name cloudmap --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-custom-attributes" @@ -292 +292 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - CREATE_OUTPUT=$(aws servicediscovery create-service --name data-service --namespace-id "$NAMESPACE_ID" --creator-request-id "data-service-request-$(date +%s)") + CREATE_OUTPUT=$(aws servicediscovery create-service --name data-service --namespace-id "$NAMESPACE_ID" --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-custom-attributes --creator-request-id "data-service-request-$(date +%s)") @@ -348,0 +349 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + aws iam tag-role --role-name cloudmap-tutorial-role --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-custom-attributes @@ -432 +433 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - CREATE_OUTPUT=$(aws servicediscovery create-service --name app-service --namespace-id "$NAMESPACE_ID" --creator-request-id "app-service-request-$(date +%s)") + CREATE_OUTPUT=$(aws servicediscovery create-service --name app-service --namespace-id "$NAMESPACE_ID" --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-custom-attributes --creator-request-id "app-service-request-$(date +%s)") @@ -505 +506 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - log_cmd "aws lambda create-function --function-name writefunction --runtime python3.12 --role $ROLE_ARN --handler writefunction.lambda_handler --zip-file fileb://writefunction.zip --architectures x86_64 --timeout 10" + log_cmd "aws lambda create-function --function-name writefunction --runtime python3.12 --role $ROLE_ARN --handler writefunction.lambda_handler --zip-file fileb://writefunction.zip --architectures x86_64 --timeout 10 --tags project=doc-smith,tutorial=cloudmap-custom-attributes" @@ -594 +595 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - log_cmd "aws lambda create-function --function-name readfunction --runtime python3.12 --role $ROLE_ARN --handler readfunction.lambda_handler --zip-file fileb://readfunction.zip --architectures x86_64 --timeout 10" + log_cmd "aws lambda create-function --function-name readfunction --runtime python3.12 --role $ROLE_ARN --handler readfunction.lambda_handler --zip-file fileb://readfunction.zip --architectures x86_64 --timeout 10 --tags project=doc-smith,tutorial=cloudmap-custom-attributes" @@ -874,0 +876 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-service-discovery \ @@ -906,0 +909 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-service-discovery \ @@ -916,0 +920 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-service-discovery \ @@ -1176 +1180,2 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - --vpc-id "$VPC_ID" 2>&1) + --vpc-id "$VPC_ID" \ + --tag-specifications 'ResourceType=security-group,Tags=[{Key=project,Value=doc-smith},{Key=tutorial,Value=amazon-ecs-service-connect}]' 2>&1) @@ -1203 +1208 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - aws logs create-log-group --log-group-name "/ecs/service-connect-nginx" 2>&1 | grep -v "ResourceAlreadyExistsException" || { + aws logs create-log-group --log-group-name "/ecs/service-connect-nginx" --tags project=doc-smith,tutorial=amazon-ecs-service-connect 2>&1 | grep -v "ResourceAlreadyExistsException" || { @@ -1213 +1218 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - aws logs create-log-group --log-group-name "/ecs/service-connect-proxy" 2>&1 | grep -v "ResourceAlreadyExistsException" || { + aws logs create-log-group --log-group-name "/ecs/service-connect-proxy" --tags project=doc-smith,tutorial=amazon-ecs-service-connect 2>&1 | grep -v "ResourceAlreadyExistsException" || { @@ -1230 +1235 @@ There's more on GitHub. Find the complete example and learn how to set up and ru - --tags key=Environment,value=tutorial 2>&1) + --tags key=Environment,value=tutorial key=project,value=doc-smith key=tutorial,value=amazon-ecs-service-connect 2>&1) @@ -1273,0 +1279 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + aws iam tag-role --role-name ecsTaskExecutionRole --tags Key=project,Value=doc-smith Key=tutorial,Value=amazon-ecs-service-connect @@ -1304,0 +1311 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + aws iam tag-role --role-name ecsTaskRole --tags Key=project,Value=doc-smith Key=tutorial,Value=amazon-ecs-service-connect @@ -1408,0 +1416,8 @@ There's more on GitHub. Find the complete example and learn how to set up and ru + }, + { + "key": "project", + "value": "doc-smith" + }, + { + "key": "tutorial", + "value": "amazon-ecs-service-connect"