AWS code-library documentation change
Summary
Added PowerShell V5 examples for managing S3 bucket tags
Security assessment
Documents resource tagging without any security-specific implications or vulnerability context.
Diff
diff --git a/code-library/latest/ug/s3_example_s3_PutBucketTagging_section.md b/code-library/latest/ug/s3_example_s3_PutBucketTagging_section.md index 1ed8e7872..31892d9f9 100644 --- a//code-library/latest/ug/s3_example_s3_PutBucketTagging_section.md +++ b//code-library/latest/ug/s3_example_s3_PutBucketTagging_section.md @@ -68,0 +69,20 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This command applies two tags to a bucket named`cloudtrail-test-2018`: a tag with a key of Stage and a value of Test, and a tag with a key of Environment and a value of Alpha. To verify that the tags were added to the bucket, run `Get-S3BucketTagging -BucketName bucket_name`. The results should show the tags that you applied to the bucket in the first command. Note that `Write-S3BucketTagging` overwrites the entire existing tag set on a bucket. To add or delete individual tags, run the Resource Groups and Tagging API cmdlets, `Add-RGTResourceTag` and `Remove-RGTResourceTag`. Alternatively, use Tag Editor in the AWS Management Console to manage S3 bucket tags.** + + + Write-S3BucketTagging -BucketName amzn-s3-demo-bucket -TagSet @( @{ Key="Stage"; Value="Test" }, @{ Key="Environment"; Value="Alpha" } ) + + +**Example 2: This command pipes a bucket named`cloudtrail-test-2018` into the `Write-S3BucketTagging` cmdlet. It applies tags Stage:Production and Department:Finance to the bucket. Note that `Write-S3BucketTagging` overwrites the entire existing tag set on a bucket.** + + + Get-S3Bucket -BucketName amzn-s3-demo-bucket | Write-S3BucketTagging -TagSet @( @{ Key="Stage"; Value="Production" }, @{ Key="Department"; Value="Finance" } ) + + + * For API details, see [PutBucketTagging](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +