Menu
AWS IoT
Developer Guide

CreateRoleAlias

Creates a role alias.

Request syntax:

POST /role-aliases/roleAlias Content-type: application/json { "roleArn": "string", "credentialDurationSeconds": "integer" }

URI Request Parameters:

Name

Type

Req?

Description

roleAlias

RoleAlias

yes

The role alias that points to a role ARN. This allows you to change the role without having to update the device.

Request Body Parameters:

Name

Type

Req?

Description

roleArn

RoleArn

yes

The role ARN.

credentialDurationSeconds

CredentialDurationSeconds

no

How long (in seconds) the credentials will be valid.

Response syntax:

Content-type: application/json { "roleAlias": "string", "roleAliasArn": "string" }

Response Body Parameters:

Name

Type

Req?

Description

roleAlias

RoleAlias

no

The role alias.

roleAliasArn

RoleAliasArn

no

The role alias ARN.

Errors:

ResourceAlreadyExistsException

The resource already exists.

HTTP response code: 409

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

LimitExceededException

The number of attached entities exceeds the limit.

HTTP response code: 410

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP response code: 401

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

CLI

Synopsis:

aws iot create-role-alias \ --role-alias <value> \ --role-arn <value> \ [--credential-duration-seconds <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "roleAlias": "string", "roleArn": "string", "credentialDurationSeconds": "integer" }

cli-input-json fields:

Name

Type

Description

roleAlias

string

length max:128 min:1

pattern: [w=,@-]+

The role alias that points to a role ARN. This allows you to change the role without having to update the device.

roleArn

string

length max:2048 min:20

The role ARN.

credentialDurationSeconds

integer

java class: java.lang.Integer

range- max:3600 min:900

How long (in seconds) the credentials will be valid.

Output:

{ "roleAlias": "string", "roleAliasArn": "string" }

cli output fields:

Name

Type

Description

roleAlias

string

length max:128 min:1

pattern: [w=,@-]+

The role alias.

roleAliasArn

string

The role alias ARN.

On this page: