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:10:40 GMT
Location: https://sdk.amazonaws.com/kotlin/api/latest/iam/aws.sdk.kotlin.services.iam/-iam-client/create-role.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 df26f98dc48faec49f463a51b15e8efc.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: BLR50-P2
X-Amz-Cf-Id: XQdz8Gi2TRD_hb_kc6VfjG8smqtJMcIfMwkbGgFci9iB8UMRaC42YA==
HTTP/1.1 200 OK
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
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
Date: Thu, 24 Jul 2025 19:10:42 GMT
Last-Modified: Wed, 23 Jul 2025 22:34:34 GMT
X-Frame-Options: SAMEORIGIN
x-amz-server-side-encryption: AES256
Content-Encoding: gzip
Server: AmazonS3
Cache-Control: no-store, no-cache, must-revalidate
Via: 1.1 c66a955cf4660e85c076e8bfb1e20fa2.cloudfront.net (CloudFront), 1.1 dea120865aff56ed8f0fb97dce1b7bee.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: TLV50-C1
X-XSS-Protection: 1; mode=block
ETag: W/"9ed847371510f996b11d3f29b011d0cd"
Vary: Accept-Encoding
X-Cache: Miss from cloudfront
X-Amz-Cf-Pop: BLR50-P1
X-Amz-Cf-Id: KWsWLeSZpJzVx1czbUc91AdY2dZkurf31mdVJv4LPJiS2xdBdU0zzw==
createRole
AWS SDK for Kotlin
create
1.5.2
Platform filter
createRole
Creates a new role for your Amazon Web Services account.
For more information about roles, see IAM roles in the IAM User Guide. For information about quotas for role names and the number of roles you can create, see IAM and STS quotas in the IAM User Guide.
Samples
fun main() {
//sampleStart
// The following command creates a role named Test Role and attaches a trust policy that you must
// convert from JSON to a string. Upon success, the response includes the same policy as a URL encoded JSON
// string.
val resp = iamClient.createRole {
assumeRolePolicyDocument = "<Stringified-JSON>"
path = "/"
roleName = "Test-Role"
}
//sampleEnd
}