aws.iot.RoleAlias
Explore with Pulumi AI
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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).
- 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.
- 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).
- 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.
- 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).
- 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.
- 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).
- {[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).
- 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.
- 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).
- 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:
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.
- 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.
- 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. - Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- 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. - map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- 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. - Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- {[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. - {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- 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. - Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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.
- 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. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
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.