Skip to content

Commit 087281d

Browse files
authored
Merge pull request #81 from aws-samples/feature/resource-tagging-v3
Resource tagging: 68/70 tutorials tagged with project=doc-smith
2 parents fe14631 + cea830a commit 087281d

69 files changed

Lines changed: 566 additions & 247 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
1-
*.log
2-
*.pem
3-
aws-eump-logs/
4-
dynamodb-tutorial-logs/
5-
Dockerfile
6-
document.png
7-
dashboard-body-*.json
8-
comprehend-policy.json
9-
hello-world.json
10-
input.json
11-
query-results.csv
12-
sentiment-*.json
13-
step-functions-trust-policy.json
14-
stepfunctions-policy.json
15-
textract-*.json
16-
updated-hello-world.json
17-
webserver-template-*.yaml
18-
qbusiness-*.json
19-
datazone_script_v3_fixed.log
20-
idc_setup_*.log
211
workspaces_creation.log
22-
logs/
23-
*.csv
24-
*.png
25-
Dockerfile
26-
cfn/
2+
datazone_script_v3_fixed.log
3+
idc_setup_20260429_064540.log
4+
qbusiness-permissions-policy.json
5+
qbusiness-trust-policy.json

tuts/001-lightsail-gs/lightsail-gs.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ aws lightsail create-instances \
122122
--availability-zone "$AVAILABILITY_ZONE" \
123123
--blueprint-id amazon_linux_2023 \
124124
--bundle-id nano_3_0 \
125-
--region "$AWS_REGION"
125+
--region "$AWS_REGION" \
126+
--tags key=project,value=doc-smith key=tutorial,value=lightsail-gs
126127
check_status "Failed to create Lightsail instance"
127128
track_resource "instance" "$INSTANCE_NAME"
128129

@@ -180,7 +181,8 @@ aws lightsail create-disk \
180181
--disk-name "$DISK_NAME" \
181182
--availability-zone "$AVAILABILITY_ZONE" \
182183
--size-in-gb 8 \
183-
--region "$AWS_REGION"
184+
--region "$AWS_REGION" \
185+
--tags key=project,value=doc-smith key=tutorial,value=lightsail-gs
184186
check_status "Failed to create disk"
185187
track_resource "disk" "$DISK_NAME"
186188

@@ -223,7 +225,8 @@ echo "Step 6: Creating snapshot of the instance: $SNAPSHOT_NAME"
223225
aws lightsail create-instance-snapshot \
224226
--instance-name "$INSTANCE_NAME" \
225227
--instance-snapshot-name "$SNAPSHOT_NAME" \
226-
--region "$AWS_REGION"
228+
--region "$AWS_REGION" \
229+
--tags key=project,value=doc-smith key=tutorial,value=lightsail-gs
227230
check_status "Failed to create instance snapshot"
228231
track_resource "instance_snapshot" "$SNAPSHOT_NAME"
229232

tuts/002-vpc-gs/vpc-gs.sh

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fi
115115

116116
# Create VPC
117117
echo "Creating VPC with CIDR block 10.0.0.0/16..."
118-
VPC_ID=$(aws ec2 create-vpc --cidr-block 10.0.0.0/16 --tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=MyVPC}]' --query 'Vpc.VpcId' --output text)
118+
VPC_ID=$(aws ec2 create-vpc --cidr-block 10.0.0.0/16 --tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=MyVPC},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' --query 'Vpc.VpcId' --output text)
119119

120120
if [ -z "$VPC_ID" ]; then
121121
handle_error "Failed to create VPC"
@@ -146,7 +146,7 @@ PUBLIC_SUBNET_AZ1=$(aws ec2 create-subnet \
146146
--vpc-id "$VPC_ID" \
147147
--cidr-block 10.0.0.0/24 \
148148
--availability-zone "$AZ1" \
149-
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=Public-Subnet-AZ1}]' \
149+
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=Public-Subnet-AZ1},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
150150
--query 'Subnet.SubnetId' \
151151
--output text)
152152

@@ -162,7 +162,7 @@ PUBLIC_SUBNET_AZ2=$(aws ec2 create-subnet \
162162
--vpc-id "$VPC_ID" \
163163
--cidr-block 10.0.1.0/24 \
164164
--availability-zone "$AZ2" \
165-
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=Public-Subnet-AZ2}]' \
165+
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=Public-Subnet-AZ2},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
166166
--query 'Subnet.SubnetId' \
167167
--output text)
168168

@@ -179,7 +179,7 @@ PRIVATE_SUBNET_AZ1=$(aws ec2 create-subnet \
179179
--vpc-id "$VPC_ID" \
180180
--cidr-block 10.0.2.0/24 \
181181
--availability-zone "$AZ1" \
182-
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=Private-Subnet-AZ1}]' \
182+
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=Private-Subnet-AZ1},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
183183
--query 'Subnet.SubnetId' \
184184
--output text)
185185

@@ -195,7 +195,7 @@ PRIVATE_SUBNET_AZ2=$(aws ec2 create-subnet \
195195
--vpc-id "$VPC_ID" \
196196
--cidr-block 10.0.3.0/24 \
197197
--availability-zone "$AZ2" \
198-
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=Private-Subnet-AZ2}]' \
198+
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=Private-Subnet-AZ2},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
199199
--query 'Subnet.SubnetId' \
200200
--output text)
201201

@@ -209,7 +209,7 @@ echo "Private subnet created in $AZ2 with ID: $PRIVATE_SUBNET_AZ2"
209209
# Create Internet Gateway
210210
echo "Creating Internet Gateway..."
211211
IGW_ID=$(aws ec2 create-internet-gateway \
212-
--tag-specifications 'ResourceType=internet-gateway,Tags=[{Key=Name,Value=MyIGW}]' \
212+
--tag-specifications 'ResourceType=internet-gateway,Tags=[{Key=Name,Value=MyIGW},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
213213
--query 'InternetGateway.InternetGatewayId' \
214214
--output text)
215215

@@ -228,7 +228,7 @@ aws ec2 attach-internet-gateway --internet-gateway-id "$IGW_ID" --vpc-id "$VPC_I
228228
echo "Creating public route table..."
229229
PUBLIC_RT=$(aws ec2 create-route-table \
230230
--vpc-id "$VPC_ID" \
231-
--tag-specifications 'ResourceType=route-table,Tags=[{Key=Name,Value=Public-RT}]' \
231+
--tag-specifications 'ResourceType=route-table,Tags=[{Key=Name,Value=Public-RT},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
232232
--query 'RouteTable.RouteTableId' \
233233
--output text)
234234

@@ -266,7 +266,7 @@ CREATED_RESOURCES+=("ROUTE_TABLE_ASSOCIATION:$PUBLIC_RT_ASSOC_2")
266266
echo "Creating private route table..."
267267
PRIVATE_RT=$(aws ec2 create-route-table \
268268
--vpc-id "$VPC_ID" \
269-
--tag-specifications 'ResourceType=route-table,Tags=[{Key=Name,Value=Private-RT}]' \
269+
--tag-specifications 'ResourceType=route-table,Tags=[{Key=Name,Value=Private-RT},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
270270
--query 'RouteTable.RouteTableId' \
271271
--output text)
272272

@@ -298,7 +298,7 @@ CREATED_RESOURCES+=("ROUTE_TABLE_ASSOCIATION:$PRIVATE_RT_ASSOC_2")
298298

299299
# Allocate Elastic IP for NAT Gateway
300300
echo "Allocating Elastic IP for NAT Gateway..."
301-
EIP_ALLOC=$(aws ec2 allocate-address --domain vpc --query 'AllocationId' --output text)
301+
EIP_ALLOC=$(aws ec2 allocate-address --domain vpc --tag-specifications 'ResourceType=elastic-ip,Tags=[{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' --query 'AllocationId' --output text)
302302

303303
if [ -z "$EIP_ALLOC" ]; then
304304
handle_error "Failed to allocate Elastic IP"
@@ -312,7 +312,7 @@ echo "Creating NAT Gateway in public subnet in $AZ1..."
312312
NAT_GW=$(aws ec2 create-nat-gateway \
313313
--subnet-id "$PUBLIC_SUBNET_AZ1" \
314314
--allocation-id "$EIP_ALLOC" \
315-
--tag-specifications 'ResourceType=natgateway,Tags=[{Key=Name,Value=MyNATGateway}]' \
315+
--tag-specifications 'ResourceType=natgateway,Tags=[{Key=Name,Value=MyNATGateway},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
316316
--query 'NatGateway.NatGatewayId' \
317317
--output text)
318318

@@ -344,6 +344,7 @@ WEB_SG=$(aws ec2 create-security-group \
344344
--group-name "WebServerSG-$(date +%s)" \
345345
--description "Security group for web servers" \
346346
--vpc-id "$VPC_ID" \
347+
--tag-specifications 'ResourceType=security-group,Tags=[{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
347348
--query 'GroupId' \
348349
--output text)
349350

@@ -370,6 +371,7 @@ DB_SG=$(aws ec2 create-security-group \
370371
--group-name "DBServerSG-$(date +%s)" \
371372
--description "Security group for database servers" \
372373
--vpc-id "$VPC_ID" \
374+
--tag-specifications 'ResourceType=security-group,Tags=[{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
373375
--query 'GroupId' \
374376
--output text)
375377

@@ -428,7 +430,7 @@ echo "Deploying EC2 instances..."
428430
# Create key pair for SSH access
429431
KEY_NAME="vpc-tutorial-key-$(date +%s)"
430432
echo "Creating key pair $KEY_NAME..."
431-
aws ec2 create-key-pair --key-name "$KEY_NAME" --query 'KeyMaterial' --output text > "${KEY_NAME}.pem" || handle_error "Failed to create key pair"
433+
aws ec2 create-key-pair --key-name "$KEY_NAME" --tag-specifications 'ResourceType=key-pair,Tags=[{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' --query 'KeyMaterial' --output text > "${KEY_NAME}.pem" || handle_error "Failed to create key pair"
432434
chmod 400 "${KEY_NAME}.pem"
433435
echo "Key pair saved to ${KEY_NAME}.pem"
434436
CREATED_RESOURCES+=("KEY_PAIR:$KEY_NAME")
@@ -456,7 +458,7 @@ WEB_INSTANCE=$(aws ec2 run-instances \
456458
systemctl start httpd
457459
systemctl enable httpd
458460
echo "<h1>Hello from $(hostname -f) in the public subnet</h1>" > /var/www/html/index.html' \
459-
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=WebServer}]' \
461+
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=WebServer},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
460462
--query 'Instances[0].InstanceId' \
461463
--output text) || handle_error "Failed to launch web server"
462464
echo "Web server instance created with ID: $WEB_INSTANCE"
@@ -486,7 +488,7 @@ DB_INSTANCE=$(aws ec2 run-instances \
486488
yum install -y mariadb-server
487489
systemctl start mariadb
488490
systemctl enable mariadb' \
489-
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=DBServer}]' \
491+
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=DBServer},{Key=project,Value=doc-smith},{Key=tutorial,Value=vpc-gs}]' \
490492
--query 'Instances[0].InstanceId' \
491493
--output text) || handle_error "Failed to launch database server"
492494
echo "Database server instance created with ID: $DB_INSTANCE"

tuts/003-s3-gettingstarted/s3-gettingstarted.sh

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,23 @@ if [ "$BUCKET_IS_SHARED" = "false" ]; then
169169
fi
170170
CREATED_RESOURCES+=("s3:bucket:${BUCKET_NAME}")
171171
echo "Bucket created."
172+
173+
if ! aws s3api put-bucket-tagging \
174+
--bucket "$BUCKET_NAME" \
175+
--tagging '{
176+
"TagSet": [
177+
{
178+
"Key": "project",
179+
"Value": "doc-smith"
180+
},
181+
{
182+
"Key": "tutorial",
183+
"Value": "s3-gettingstarted"
184+
}
185+
]
186+
}' >/dev/null 2>&1; then
187+
echo "WARNING: Failed to tag bucket"
188+
fi
172189
fi
173190
echo ""
174191

@@ -317,12 +334,29 @@ LOG_TARGET_BUCKET="${BUCKET_NAME}-logs"
317334
if [ "$BUCKET_IS_SHARED" = "false" ]; then
318335
REGION=$(get_region)
319336
if [ "$REGION" = "us-east-1" ]; then
320-
aws s3api create-bucket --bucket "$LOG_TARGET_BUCKET" 2>/dev/null || true
337+
aws s3api create-bucket --bucket "$LOG_TARGET_BUCKET" >/dev/null 2>&1 || true
321338
else
322339
aws s3api create-bucket \
323340
--bucket "$LOG_TARGET_BUCKET" \
324341
--region "$REGION" \
325-
--create-bucket-configuration LocationConstraint="$REGION" 2>/dev/null || true
342+
--create-bucket-configuration LocationConstraint="$REGION" >/dev/null 2>&1 || true
343+
fi
344+
345+
if ! aws s3api put-bucket-tagging \
346+
--bucket "$LOG_TARGET_BUCKET" \
347+
--tagging '{
348+
"TagSet": [
349+
{
350+
"Key": "project",
351+
"Value": "doc-smith"
352+
},
353+
{
354+
"Key": "tutorial",
355+
"Value": "s3-gettingstarted"
356+
}
357+
]
358+
}' >/dev/null 2>&1; then
359+
echo "WARNING: Failed to tag log bucket"
326360
fi
327361

328362
aws s3api put-bucket-acl --bucket "$LOG_TARGET_BUCKET" --acl log-delivery-write 2>/dev/null || true
@@ -354,6 +388,14 @@ if ! aws s3api put-bucket-tagging \
354388
--bucket "$BUCKET_NAME" \
355389
--tagging '{
356390
"TagSet": [
391+
{
392+
"Key": "project",
393+
"Value": "doc-smith"
394+
},
395+
{
396+
"Key": "tutorial",
397+
"Value": "s3-gettingstarted"
398+
},
357399
{
358400
"Key": "Environment",
359401
"Value": "Tutorial"

tuts/004-cloudmap-custom-attributes/cloudmap-custom-attributes.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ NAMESPACE_ID=$(aws servicediscovery list-namespaces --query "Namespaces[?Name=='
180180

181181
if [[ -z "$NAMESPACE_ID" || "$NAMESPACE_ID" == "None" ]]; then
182182
log_cmd "aws servicediscovery create-http-namespace --name cloudmap-tutorial --creator-request-id namespace-request-\$(date +%s)"
183-
OPERATION_ID=$(aws servicediscovery create-http-namespace --name cloudmap-tutorial --creator-request-id "namespace-request-$(date +%s)" --query 'OperationId' --output text)
183+
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)
184184

185185
# Wait for namespace creation to complete
186186
echo "Waiting for namespace creation to complete..." | tee -a "$LOG_FILE"
@@ -202,7 +202,7 @@ echo "Step 2: Creating DynamoDB table..." | tee -a "$LOG_FILE"
202202
TABLE_EXISTS=$(aws dynamodb describe-table --table-name cloudmap 2>&1 || echo "NOT_EXISTS")
203203

204204
if [[ $TABLE_EXISTS == *"ResourceNotFoundException"* || $TABLE_EXISTS == "NOT_EXISTS" ]]; then
205-
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"
205+
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"
206206

207207
# Wait for DynamoDB table to become active
208208
echo "Waiting for DynamoDB table to become active..." | tee -a "$LOG_FILE"
@@ -235,7 +235,7 @@ if [[ -z "$DATA_SERVICE_ID" ]]; then
235235
echo "Data service does not exist, creating it..." | tee -a "$LOG_FILE"
236236
# Create the service and capture the ID directly
237237
echo "$ aws servicediscovery create-service --name data-service --namespace-id $NAMESPACE_ID --creator-request-id data-service-request-\$(date +%s)" | tee -a "$LOG_FILE"
238-
CREATE_OUTPUT=$(aws servicediscovery create-service --name data-service --namespace-id "$NAMESPACE_ID" --creator-request-id "data-service-request-$(date +%s)")
238+
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)")
239239
echo "$CREATE_OUTPUT" | tee -a "$LOG_FILE"
240240

241241
# Extract the service ID using AWS CLI query
@@ -292,6 +292,7 @@ ROLE_EXISTS=$(aws iam get-role --role-name cloudmap-tutorial-role 2>&1 || echo "
292292

293293
if [[ $ROLE_EXISTS == *"NoSuchEntity"* || $ROLE_EXISTS == "NOT_EXISTS" ]]; then
294294
log_cmd "aws iam create-role --role-name cloudmap-tutorial-role --assume-role-policy-document file://lambda-trust-policy.json"
295+
aws iam tag-role --role-name cloudmap-tutorial-role --tags Key=project,Value=doc-smith Key=tutorial,Value=cloudmap-custom-attributes
295296
else
296297
echo "Role cloudmap-tutorial-role already exists, using existing role" | tee -a "$LOG_FILE"
297298
fi
@@ -375,7 +376,7 @@ if [[ -z "$APP_SERVICE_ID" ]]; then
375376
echo "App service does not exist, creating it..." | tee -a "$LOG_FILE"
376377
# Create the service and capture the ID directly
377378
echo "$ aws servicediscovery create-service --name app-service --namespace-id $NAMESPACE_ID --creator-request-id app-service-request-\$(date +%s)" | tee -a "$LOG_FILE"
378-
CREATE_OUTPUT=$(aws servicediscovery create-service --name app-service --namespace-id "$NAMESPACE_ID" --creator-request-id "app-service-request-$(date +%s)")
379+
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)")
379380
echo "$CREATE_OUTPUT" | tee -a "$LOG_FILE"
380381

381382
# Extract the service ID using AWS CLI query
@@ -448,7 +449,7 @@ log_cmd "zip writefunction.zip writefunction.py"
448449
# Create the Lambda function
449450
FUNCTION_EXISTS=$(aws lambda list-functions --query "Functions[?FunctionName=='writefunction'].FunctionName" --output text 2>/dev/null || echo "")
450451
if [[ -z "$FUNCTION_EXISTS" ]]; then
451-
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"
452+
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"
452453

453454
# Wait for the Lambda function to be active before updating
454455
echo "Waiting for Lambda function to become active..." | tee -a "$LOG_FILE"
@@ -537,7 +538,7 @@ log_cmd "zip readfunction.zip readfunction.py"
537538
# Create the Lambda function
538539
FUNCTION_EXISTS=$(aws lambda list-functions --query "Functions[?FunctionName=='readfunction'].FunctionName" --output text 2>/dev/null || echo "")
539540
if [[ -z "$FUNCTION_EXISTS" ]]; then
540-
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"
541+
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"
541542

542543
# Wait for the Lambda function to be active before updating
543544
echo "Waiting for Lambda function to become active..." | tee -a "$LOG_FILE"

tuts/005-cloudfront-gettingstarted/cloudfront-gettingstarted.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ if [ "$BUCKET_IS_SHARED" != "true" ]; then
179179
handle_error "Failed to create S3 bucket"
180180
fi
181181

182+
aws s3api put-bucket-tagging --bucket "$BUCKET_NAME" --tagging 'TagSet=[{Key=project,Value=doc-smith},{Key=tutorial,Value=cloudfront-gettingstarted}]'
183+
182184
# Batch bucket configuration calls for efficiency
183185
aws s3api put-bucket-versioning --bucket "$BUCKET_NAME" --versioning-configuration Status=Enabled &
184186
aws s3api put-public-access-block \
@@ -335,6 +337,9 @@ fi
335337
echo "Created CloudFront distribution with ID: $DISTRIBUTION_ID"
336338
echo "CloudFront domain name: $DOMAIN_NAME"
337339

340+
# Tag the CloudFront distribution
341+
aws cloudfront tag-resource --resource "arn:aws:cloudfront::$ACCOUNT_ID:distribution/$DISTRIBUTION_ID" --tags 'Items=[{Key=project,Value=doc-smith},{Key=tutorial,Value=cloudfront-gettingstarted}]'
342+
338343
# Step 6: Update S3 bucket policy
339344
echo "Updating S3 bucket policy..."
340345

0 commit comments

Comments
 (0)