CARVIEW |
Select Language
HTTP/1.1 302 Moved Temporarily
Content-Type: text/html; charset=iso-8859-1
Content-Length: 288
Connection: keep-alive
Date: Thu, 24 Jul 2025 19:15:38 GMT
Location: https://sdk.amazonaws.com/kotlin/api/latest/ec2/aws.sdk.kotlin.services.ec2/-ec2-client/create-tags.html
Server: Server
Cache-Control: max-age=600
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=47304000; includeSubDomains
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: upgrade-insecure-requests; script-src 'self' 'unsafe-inline' *.awsstatic.com *.cdn.uis.awsstatic.com *.cdn.console.awsstatic.com d2c.aws.amazon.com a0.awsstatic.com *.feedback.console.aws.dev insights.docs.aws.com wss://insights.docs.aws.com/prod; object-src 'none';
X-Cache: Miss from cloudfront
Via: 1.1 204734520f5130526e378b271a301fda.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: BOM78-P5
X-Amz-Cf-Id: 5lyVsT4caENqPviQOTDj9vjw-VRPbcxdF-XwS6riSXFserMznxPRug==
HTTP/1.1 200 OK
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Date: Thu, 24 Jul 2025 19:15:41 GMT
Last-Modified: Wed, 23 Jul 2025 22:27:42 GMT
ETag: W/"b89674f3ed59aabe5410af3be67b733e"
x-amz-server-side-encryption: AES256
Server: AmazonS3
Via: 1.1 16f88a640328f5c5351c2916207f0148.cloudfront.net (CloudFront), 1.1 f7d4d49cc3e3738b2d7cc1f7542267b6.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: TLV50-C1
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: upgrade-insecure-requests; script-src 'self' 'unsafe-inline' *.awsstatic.com *.cdn.uis.awsstatic.com *.cdn.console.awsstatic.com docs.aws.amazon.com https://*.shortbread.aws.dev; img-src 'self' https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/; frame-src 'self' https://aws.demdex.net https://dpm.demdex.net; connect-src 'self' https://amazonwebservices.d2.sc.omtrdc.net https://aws.demdex.net https://dpm.demdex.net https://cm.everesttech.net https://a0.awsstatic.com/ https://d2c.aws.amazon.com https://vs.aws.amazon.com https://*.shortbread.aws.dev; object-src 'none'; frame-ancestors 'self'; base-uri 'none'
Strict-Transport-Security: max-age=31536000
Cache-Control: no-store, no-cache, must-revalidate
Content-Encoding: gzip
Vary: Accept-Encoding
X-Cache: Miss from cloudfront
X-Amz-Cf-Pop: BOM78-P1
X-Amz-Cf-Id: 41ZfCmogck6pxtDHokJjfHsIkfUApRy2OVU7EKz_eK2cQq9DmFtFrQ==
createTags
AWS SDK for Kotlin
create
1.5.2
Platform filter
createTags
Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources. When you specify an existing tag key, the value is overwritten with the new value. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.
For more information about tags, see Tag your Amazon EC2 resources in the Amazon Elastic Compute Cloud User Guide. For more information about creating IAM policies that control users' access to resources based on tags, see Supported resource-level permissions for Amazon EC2 API actions in the Amazon Elastic Compute Cloud User Guide.
Samples
import aws.sdk.kotlin.services.ec2.model.Tag
fun main() {
//sampleStart
// This example adds the tag Stack production to the specified image, or overwrites an existing tag for
// the AMI where the tag key is Stack.
ec2Client.createTags {
resources = listOf<String>(
"ami-78a54011"
)
tags = listOf<Tag>(
Tag {
key = "Stack"
value = "production"
}
)
}
//sampleEnd
}