AWS Classic
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/v5/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v5/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.Any(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
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var role = new Role("role", RoleArgs.builder()
.assumeRolePolicy("""
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"Service": "credentials.iot.amazonaws.com",
"Action": "sts:AssumeRole"
}
]
}
""")
.build());
var alias = new RoleAlias("alias", RoleAliasArgs.builder()
.alias("Thermostat-dynamodb-access-role-alias")
.roleArn(role.arn())
.build());
}
}
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,
});
resources:
role:
type: aws:iam:Role
properties:
assumeRolePolicy: |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"Service": "credentials.iot.amazonaws.com",
"Action": "sts:AssumeRole"
}
]
}
alias:
type: aws:iot:RoleAlias
properties:
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)
public RoleAlias(String name, RoleAliasArgs args)
public RoleAlias(String name, RoleAliasArgs args, CustomResourceOptions options)
type: aws:iot:RoleAlias
properties: # The arguments to resource properties.
options: # 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.
- 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.
- name String
- The unique name of the resource.
- args RoleAliasArgs
- The arguments to resource properties.
- options 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 Architecture and Concepts docs.
Inputs
The RoleAlias resource accepts the following input properties:
- Alias string
The name of the role alias.
- Role
Arn string 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 43200 seconds (12 hours).
- Alias string
The name of the role alias.
- Role
Arn string 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 43200 seconds (12 hours).
- alias String
The name of the role alias.
- role
Arn String The identity of the role to which the alias refers.
- credential
Duration Integer 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 43200 seconds (12 hours).
- alias string
The name of the role alias.
- role
Arn string The identity of the role to which the alias refers.
- credential
Duration 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 43200 seconds (12 hours).
- 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 43200 seconds (12 hours).
- alias String
The name of the role alias.
- role
Arn String The identity of the role to which the alias refers.
- credential
Duration 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 43200 seconds (12 hours).
Outputs
All input properties are implicitly available as output properties. Additionally, the RoleAlias resource produces the following output properties:
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)
public static RoleAlias get(String name, Output<String> id, RoleAliasState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Alias string
The name of the role alias.
- Arn string
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 43200 seconds (12 hours).
- Role
Arn 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.
- 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 43200 seconds (12 hours).
- Role
Arn 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.
- credential
Duration Integer 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 43200 seconds (12 hours).
- role
Arn 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.
- credential
Duration 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 43200 seconds (12 hours).
- role
Arn 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 43200 seconds (12 hours).
- role_
arn str 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.
- credential
Duration 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 43200 seconds (12 hours).
- role
Arn String 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.