RoleAlias

Provides an IoT role alias.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var role = new Aws.Iam.Role("role", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": [
    {
      ""Effect"": ""Allow"",
      ""Principal"": {""Service"": ""credentials.iot.amazonaws.com"",
      ""Action"": ""sts:AssumeRole""
    }
  ]
}
",
        });
        var @alias = new Aws.Iot.RoleAlias("alias", new Aws.Iot.RoleAliasArgs
        {
            Alias = "Thermostat-dynamodb-access-role-alias",
            RoleArn = role.Arn,
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/iot"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		role, err := iam.NewRole(ctx, "role", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"Version\": \"2012-10-17\",\n", "  \"Statement\": [\n", "    {\n", "      \"Effect\": \"Allow\",\n", "      \"Principal\": {\"Service\": \"credentials.iot.amazonaws.com\",\n", "      \"Action\": \"sts:AssumeRole\"\n", "    }\n", "  ]\n", "}\n")),
		})
		if err != nil {
			return err
		}
		_, err = iot.NewRoleAlias(ctx, "alias", &iot.RoleAliasArgs{
			Alias:   pulumi.String("Thermostat-dynamodb-access-role-alias"),
			RoleArn: role.Arn,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

role = aws.iam.Role("role", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {"Service": "credentials.iot.amazonaws.com",
      "Action": "sts:AssumeRole"
    }
  ]
}
""")
alias = aws.iot.RoleAlias("alias",
    alias="Thermostat-dynamodb-access-role-alias",
    role_arn=role.arn)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const role = new aws.iam.Role("role", {assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {"Service": "credentials.iot.amazonaws.com",
      "Action": "sts:AssumeRole"
    }
  ]
}
`});
const alias = new aws.iot.RoleAlias("alias", {
    alias: "Thermostat-dynamodb-access-role-alias",
    roleArn: role.arn,
});

Create a RoleAlias Resource

new RoleAlias(name: string, args: RoleAliasArgs, opts?: CustomResourceOptions);
@overload
def RoleAlias(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              alias: Optional[str] = None,
              credential_duration: Optional[int] = None,
              role_arn: Optional[str] = None)
@overload
def RoleAlias(resource_name: str,
              args: RoleAliasArgs,
              opts: Optional[ResourceOptions] = None)
func NewRoleAlias(ctx *Context, name string, args RoleAliasArgs, opts ...ResourceOption) (*RoleAlias, error)
public RoleAlias(string name, RoleAliasArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RoleAliasArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args RoleAliasArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RoleAliasArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RoleAliasArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

RoleAlias Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The RoleAlias resource accepts the following input properties:

Alias string
The name of the role alias.
RoleArn string
The identity of the role to which the alias refers.
CredentialDuration int
The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 3600 seconds (60 minutes).
Alias string
The name of the role alias.
RoleArn string
The identity of the role to which the alias refers.
CredentialDuration int
The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 3600 seconds (60 minutes).
alias string
The name of the role alias.
roleArn string
The identity of the role to which the alias refers.
credentialDuration number
The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 3600 seconds (60 minutes).
alias str
The name of the role alias.
role_arn str
The identity of the role to which the alias refers.
credential_duration int
The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 3600 seconds (60 minutes).

Outputs

All input properties are implicitly available as output properties. Additionally, the RoleAlias resource produces the following output properties:

Arn string
The ARN assigned by AWS to this role alias.
Id string
The provider-assigned unique ID for this managed resource.
Arn string
The ARN assigned by AWS to this role alias.
Id string
The provider-assigned unique ID for this managed resource.
arn string
The ARN assigned by AWS to this role alias.
id string
The provider-assigned unique ID for this managed resource.
arn str
The ARN assigned by AWS to this role alias.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing RoleAlias Resource

Get an existing RoleAlias resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RoleAliasState, opts?: CustomResourceOptions): RoleAlias
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        alias: Optional[str] = None,
        arn: Optional[str] = None,
        credential_duration: Optional[int] = None,
        role_arn: Optional[str] = None) -> RoleAlias
func GetRoleAlias(ctx *Context, name string, id IDInput, state *RoleAliasState, opts ...ResourceOption) (*RoleAlias, error)
public static RoleAlias Get(string name, Input<string> id, RoleAliasState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Alias string
The name of the role alias.
Arn string
The ARN assigned by AWS to this role alias.
CredentialDuration int
The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 3600 seconds (60 minutes).
RoleArn string
The identity of the role to which the alias refers.
Alias string
The name of the role alias.
Arn string
The ARN assigned by AWS to this role alias.
CredentialDuration int
The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 3600 seconds (60 minutes).
RoleArn string
The identity of the role to which the alias refers.
alias string
The name of the role alias.
arn string
The ARN assigned by AWS to this role alias.
credentialDuration number
The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 3600 seconds (60 minutes).
roleArn string
The identity of the role to which the alias refers.
alias str
The name of the role alias.
arn str
The ARN assigned by AWS to this role alias.
credential_duration int
The duration of the credential, in seconds. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 900 seconds (15 minutes) to 3600 seconds (60 minutes).
role_arn str
The identity of the role to which the alias refers.

Import

IOT Role Alias can be imported via the alias, e.g.

 $ pulumi import aws:iot/roleAlias:RoleAlias example myalias

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.