1. Packages
  2. AWS Classic
  3. API Docs
  4. iot
  5. RoleAlias

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.45.0 published on Tuesday, Jul 16, 2024 by Pulumi

aws.iot.RoleAlias

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.45.0 published on Tuesday, Jul 16, 2024 by Pulumi

    Provides an IoT role alias.

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iam.IamFunctions;
    import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
    import com.pulumi.aws.iam.Role;
    import com.pulumi.aws.iam.RoleArgs;
    import com.pulumi.aws.iot.RoleAlias;
    import com.pulumi.aws.iot.RoleAliasArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
                .effect("Allow")
                .principals(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                .actions("sts:AssumeRole")
                .build());
    
            var role = new Role("role", RoleArgs.builder()
                .name("dynamodb-access-role")
                .assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
                .build());
    
            var alias = new RoleAlias("alias", RoleAliasArgs.builder()
                .alias("Thermostat-dynamodb-access-role-alias")
                .roleArn(role.arn())
                .build());
    
        }
    }
    
    resources:
      role:
        type: aws:iam:Role
        properties:
          name: dynamodb-access-role
          assumeRolePolicy: ${assumeRole.json}
      alias:
        type: aws:iot:RoleAlias
        properties:
          alias: Thermostat-dynamodb-access-role-alias
          roleArn: ${role.arn}
    variables:
      assumeRole:
        fn::invoke:
          Function: aws:iam:getPolicyDocument
          Arguments:
            effect: Allow
            principals:
              - type: Service
                identifiers:
                  - credentials.iot.amazonaws.com
            actions:
              - sts:AssumeRole
    

    Create RoleAlias Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RoleAlias(name: string, args: RoleAliasArgs, opts?: CustomResourceOptions);
    @overload
    def RoleAlias(resource_name: str,
                  args: RoleAliasArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def RoleAlias(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  alias: Optional[str] = None,
                  role_arn: Optional[str] = None,
                  credential_duration: Optional[int] = None,
                  tags: Optional[Mapping[str, str]] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var roleAliasResource = new Aws.Iot.RoleAlias("roleAliasResource", new()
    {
        Alias = "string",
        RoleArn = "string",
        CredentialDuration = 0,
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := iot.NewRoleAlias(ctx, "roleAliasResource", &iot.RoleAliasArgs{
    	Alias:              pulumi.String("string"),
    	RoleArn:            pulumi.String("string"),
    	CredentialDuration: pulumi.Int(0),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var roleAliasResource = new RoleAlias("roleAliasResource", RoleAliasArgs.builder()
        .alias("string")
        .roleArn("string")
        .credentialDuration(0)
        .tags(Map.of("string", "string"))
        .build());
    
    role_alias_resource = aws.iot.RoleAlias("roleAliasResource",
        alias="string",
        role_arn="string",
        credential_duration=0,
        tags={
            "string": "string",
        })
    
    const roleAliasResource = new aws.iot.RoleAlias("roleAliasResource", {
        alias: "string",
        roleArn: "string",
        credentialDuration: 0,
        tags: {
            string: "string",
        },
    });
    
    type: aws:iot:RoleAlias
    properties:
        alias: string
        credentialDuration: 0
        roleArn: string
        tags:
            string: string
    

    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.
    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 43200 seconds (12 hours).
    Tags Dictionary<string, string>
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    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 43200 seconds (12 hours).
    Tags map[string]string
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    alias String
    The name of the role alias.
    roleArn String
    The identity of the role to which the alias refers.
    credentialDuration 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).
    tags Map<String,String>
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    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 43200 seconds (12 hours).
    tags {[key: string]: string}
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    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).
    tags Mapping[str, str]
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    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 43200 seconds (12 hours).
    tags Map<String>
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    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.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Arn string
    The ARN assigned by AWS to this role alias.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The ARN assigned by AWS to this role alias.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn string
    The ARN assigned by AWS to this role alias.
    id string
    The provider-assigned unique ID for this managed resource.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn str
    The ARN assigned by AWS to this role alias.
    id str
    The provider-assigned unique ID for this managed resource.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The ARN assigned by AWS to this role alias.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Look up 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,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, 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.
    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 43200 seconds (12 hours).
    RoleArn string
    The identity of the role to which the alias refers.
    Tags Dictionary<string, string>
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    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 43200 seconds (12 hours).
    RoleArn string
    The identity of the role to which the alias refers.
    Tags map[string]string
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    alias String
    The name of the role alias.
    arn String
    The ARN assigned by AWS to this role alias.
    credentialDuration 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).
    roleArn String
    The identity of the role to which the alias refers.
    tags Map<String,String>
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    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 43200 seconds (12 hours).
    roleArn string
    The identity of the role to which the alias refers.
    tags {[key: string]: string}
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    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.
    tags Mapping[str, str]
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    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 43200 seconds (12 hours).
    roleArn String
    The identity of the role to which the alias refers.
    tags Map<String>
    Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Import

    Using pulumi import, import IOT Role Alias using the alias. For example:

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.45.0 published on Tuesday, Jul 16, 2024 by Pulumi