github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/iot/roleAlias.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package iot
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides an IoT role alias.
    16  //
    17  // ## Import
    18  //
    19  // Using `pulumi import`, import IOT Role Alias using the alias. For example:
    20  //
    21  // ```sh
    22  // $ pulumi import aws:iot/roleAlias:RoleAlias example myalias
    23  // ```
    24  type RoleAlias struct {
    25  	pulumi.CustomResourceState
    26  
    27  	// The name of the role alias.
    28  	Alias pulumi.StringOutput `pulumi:"alias"`
    29  	// The ARN assigned by AWS to this role alias.
    30  	Arn pulumi.StringOutput `pulumi:"arn"`
    31  	// 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).
    32  	CredentialDuration pulumi.IntPtrOutput `pulumi:"credentialDuration"`
    33  	// The identity of the role to which the alias refers.
    34  	RoleArn pulumi.StringOutput `pulumi:"roleArn"`
    35  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    36  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    37  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    38  	//
    39  	// Deprecated: Please use `tags` instead.
    40  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    41  }
    42  
    43  // NewRoleAlias registers a new resource with the given unique name, arguments, and options.
    44  func NewRoleAlias(ctx *pulumi.Context,
    45  	name string, args *RoleAliasArgs, opts ...pulumi.ResourceOption) (*RoleAlias, error) {
    46  	if args == nil {
    47  		return nil, errors.New("missing one or more required arguments")
    48  	}
    49  
    50  	if args.Alias == nil {
    51  		return nil, errors.New("invalid value for required argument 'Alias'")
    52  	}
    53  	if args.RoleArn == nil {
    54  		return nil, errors.New("invalid value for required argument 'RoleArn'")
    55  	}
    56  	opts = internal.PkgResourceDefaultOpts(opts)
    57  	var resource RoleAlias
    58  	err := ctx.RegisterResource("aws:iot/roleAlias:RoleAlias", name, args, &resource, opts...)
    59  	if err != nil {
    60  		return nil, err
    61  	}
    62  	return &resource, nil
    63  }
    64  
    65  // GetRoleAlias gets an existing RoleAlias resource's state with the given name, ID, and optional
    66  // state properties that are used to uniquely qualify the lookup (nil if not required).
    67  func GetRoleAlias(ctx *pulumi.Context,
    68  	name string, id pulumi.IDInput, state *RoleAliasState, opts ...pulumi.ResourceOption) (*RoleAlias, error) {
    69  	var resource RoleAlias
    70  	err := ctx.ReadResource("aws:iot/roleAlias:RoleAlias", name, id, state, &resource, opts...)
    71  	if err != nil {
    72  		return nil, err
    73  	}
    74  	return &resource, nil
    75  }
    76  
    77  // Input properties used for looking up and filtering RoleAlias resources.
    78  type roleAliasState struct {
    79  	// The name of the role alias.
    80  	Alias *string `pulumi:"alias"`
    81  	// The ARN assigned by AWS to this role alias.
    82  	Arn *string `pulumi:"arn"`
    83  	// 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).
    84  	CredentialDuration *int `pulumi:"credentialDuration"`
    85  	// The identity of the role to which the alias refers.
    86  	RoleArn *string `pulumi:"roleArn"`
    87  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    88  	Tags map[string]string `pulumi:"tags"`
    89  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    90  	//
    91  	// Deprecated: Please use `tags` instead.
    92  	TagsAll map[string]string `pulumi:"tagsAll"`
    93  }
    94  
    95  type RoleAliasState struct {
    96  	// The name of the role alias.
    97  	Alias pulumi.StringPtrInput
    98  	// The ARN assigned by AWS to this role alias.
    99  	Arn pulumi.StringPtrInput
   100  	// 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).
   101  	CredentialDuration pulumi.IntPtrInput
   102  	// The identity of the role to which the alias refers.
   103  	RoleArn pulumi.StringPtrInput
   104  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   105  	Tags pulumi.StringMapInput
   106  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   107  	//
   108  	// Deprecated: Please use `tags` instead.
   109  	TagsAll pulumi.StringMapInput
   110  }
   111  
   112  func (RoleAliasState) ElementType() reflect.Type {
   113  	return reflect.TypeOf((*roleAliasState)(nil)).Elem()
   114  }
   115  
   116  type roleAliasArgs struct {
   117  	// The name of the role alias.
   118  	Alias string `pulumi:"alias"`
   119  	// 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).
   120  	CredentialDuration *int `pulumi:"credentialDuration"`
   121  	// The identity of the role to which the alias refers.
   122  	RoleArn string `pulumi:"roleArn"`
   123  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   124  	Tags map[string]string `pulumi:"tags"`
   125  }
   126  
   127  // The set of arguments for constructing a RoleAlias resource.
   128  type RoleAliasArgs struct {
   129  	// The name of the role alias.
   130  	Alias pulumi.StringInput
   131  	// 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).
   132  	CredentialDuration pulumi.IntPtrInput
   133  	// The identity of the role to which the alias refers.
   134  	RoleArn pulumi.StringInput
   135  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   136  	Tags pulumi.StringMapInput
   137  }
   138  
   139  func (RoleAliasArgs) ElementType() reflect.Type {
   140  	return reflect.TypeOf((*roleAliasArgs)(nil)).Elem()
   141  }
   142  
   143  type RoleAliasInput interface {
   144  	pulumi.Input
   145  
   146  	ToRoleAliasOutput() RoleAliasOutput
   147  	ToRoleAliasOutputWithContext(ctx context.Context) RoleAliasOutput
   148  }
   149  
   150  func (*RoleAlias) ElementType() reflect.Type {
   151  	return reflect.TypeOf((**RoleAlias)(nil)).Elem()
   152  }
   153  
   154  func (i *RoleAlias) ToRoleAliasOutput() RoleAliasOutput {
   155  	return i.ToRoleAliasOutputWithContext(context.Background())
   156  }
   157  
   158  func (i *RoleAlias) ToRoleAliasOutputWithContext(ctx context.Context) RoleAliasOutput {
   159  	return pulumi.ToOutputWithContext(ctx, i).(RoleAliasOutput)
   160  }
   161  
   162  // RoleAliasArrayInput is an input type that accepts RoleAliasArray and RoleAliasArrayOutput values.
   163  // You can construct a concrete instance of `RoleAliasArrayInput` via:
   164  //
   165  //	RoleAliasArray{ RoleAliasArgs{...} }
   166  type RoleAliasArrayInput interface {
   167  	pulumi.Input
   168  
   169  	ToRoleAliasArrayOutput() RoleAliasArrayOutput
   170  	ToRoleAliasArrayOutputWithContext(context.Context) RoleAliasArrayOutput
   171  }
   172  
   173  type RoleAliasArray []RoleAliasInput
   174  
   175  func (RoleAliasArray) ElementType() reflect.Type {
   176  	return reflect.TypeOf((*[]*RoleAlias)(nil)).Elem()
   177  }
   178  
   179  func (i RoleAliasArray) ToRoleAliasArrayOutput() RoleAliasArrayOutput {
   180  	return i.ToRoleAliasArrayOutputWithContext(context.Background())
   181  }
   182  
   183  func (i RoleAliasArray) ToRoleAliasArrayOutputWithContext(ctx context.Context) RoleAliasArrayOutput {
   184  	return pulumi.ToOutputWithContext(ctx, i).(RoleAliasArrayOutput)
   185  }
   186  
   187  // RoleAliasMapInput is an input type that accepts RoleAliasMap and RoleAliasMapOutput values.
   188  // You can construct a concrete instance of `RoleAliasMapInput` via:
   189  //
   190  //	RoleAliasMap{ "key": RoleAliasArgs{...} }
   191  type RoleAliasMapInput interface {
   192  	pulumi.Input
   193  
   194  	ToRoleAliasMapOutput() RoleAliasMapOutput
   195  	ToRoleAliasMapOutputWithContext(context.Context) RoleAliasMapOutput
   196  }
   197  
   198  type RoleAliasMap map[string]RoleAliasInput
   199  
   200  func (RoleAliasMap) ElementType() reflect.Type {
   201  	return reflect.TypeOf((*map[string]*RoleAlias)(nil)).Elem()
   202  }
   203  
   204  func (i RoleAliasMap) ToRoleAliasMapOutput() RoleAliasMapOutput {
   205  	return i.ToRoleAliasMapOutputWithContext(context.Background())
   206  }
   207  
   208  func (i RoleAliasMap) ToRoleAliasMapOutputWithContext(ctx context.Context) RoleAliasMapOutput {
   209  	return pulumi.ToOutputWithContext(ctx, i).(RoleAliasMapOutput)
   210  }
   211  
   212  type RoleAliasOutput struct{ *pulumi.OutputState }
   213  
   214  func (RoleAliasOutput) ElementType() reflect.Type {
   215  	return reflect.TypeOf((**RoleAlias)(nil)).Elem()
   216  }
   217  
   218  func (o RoleAliasOutput) ToRoleAliasOutput() RoleAliasOutput {
   219  	return o
   220  }
   221  
   222  func (o RoleAliasOutput) ToRoleAliasOutputWithContext(ctx context.Context) RoleAliasOutput {
   223  	return o
   224  }
   225  
   226  // The name of the role alias.
   227  func (o RoleAliasOutput) Alias() pulumi.StringOutput {
   228  	return o.ApplyT(func(v *RoleAlias) pulumi.StringOutput { return v.Alias }).(pulumi.StringOutput)
   229  }
   230  
   231  // The ARN assigned by AWS to this role alias.
   232  func (o RoleAliasOutput) Arn() pulumi.StringOutput {
   233  	return o.ApplyT(func(v *RoleAlias) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   234  }
   235  
   236  // 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).
   237  func (o RoleAliasOutput) CredentialDuration() pulumi.IntPtrOutput {
   238  	return o.ApplyT(func(v *RoleAlias) pulumi.IntPtrOutput { return v.CredentialDuration }).(pulumi.IntPtrOutput)
   239  }
   240  
   241  // The identity of the role to which the alias refers.
   242  func (o RoleAliasOutput) RoleArn() pulumi.StringOutput {
   243  	return o.ApplyT(func(v *RoleAlias) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput)
   244  }
   245  
   246  // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   247  func (o RoleAliasOutput) Tags() pulumi.StringMapOutput {
   248  	return o.ApplyT(func(v *RoleAlias) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   249  }
   250  
   251  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   252  //
   253  // Deprecated: Please use `tags` instead.
   254  func (o RoleAliasOutput) TagsAll() pulumi.StringMapOutput {
   255  	return o.ApplyT(func(v *RoleAlias) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   256  }
   257  
   258  type RoleAliasArrayOutput struct{ *pulumi.OutputState }
   259  
   260  func (RoleAliasArrayOutput) ElementType() reflect.Type {
   261  	return reflect.TypeOf((*[]*RoleAlias)(nil)).Elem()
   262  }
   263  
   264  func (o RoleAliasArrayOutput) ToRoleAliasArrayOutput() RoleAliasArrayOutput {
   265  	return o
   266  }
   267  
   268  func (o RoleAliasArrayOutput) ToRoleAliasArrayOutputWithContext(ctx context.Context) RoleAliasArrayOutput {
   269  	return o
   270  }
   271  
   272  func (o RoleAliasArrayOutput) Index(i pulumi.IntInput) RoleAliasOutput {
   273  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RoleAlias {
   274  		return vs[0].([]*RoleAlias)[vs[1].(int)]
   275  	}).(RoleAliasOutput)
   276  }
   277  
   278  type RoleAliasMapOutput struct{ *pulumi.OutputState }
   279  
   280  func (RoleAliasMapOutput) ElementType() reflect.Type {
   281  	return reflect.TypeOf((*map[string]*RoleAlias)(nil)).Elem()
   282  }
   283  
   284  func (o RoleAliasMapOutput) ToRoleAliasMapOutput() RoleAliasMapOutput {
   285  	return o
   286  }
   287  
   288  func (o RoleAliasMapOutput) ToRoleAliasMapOutputWithContext(ctx context.Context) RoleAliasMapOutput {
   289  	return o
   290  }
   291  
   292  func (o RoleAliasMapOutput) MapIndex(k pulumi.StringInput) RoleAliasOutput {
   293  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RoleAlias {
   294  		return vs[0].(map[string]*RoleAlias)[vs[1].(string)]
   295  	}).(RoleAliasOutput)
   296  }
   297  
   298  func init() {
   299  	pulumi.RegisterInputType(reflect.TypeOf((*RoleAliasInput)(nil)).Elem(), &RoleAlias{})
   300  	pulumi.RegisterInputType(reflect.TypeOf((*RoleAliasArrayInput)(nil)).Elem(), RoleAliasArray{})
   301  	pulumi.RegisterInputType(reflect.TypeOf((*RoleAliasMapInput)(nil)).Elem(), RoleAliasMap{})
   302  	pulumi.RegisterOutputType(RoleAliasOutput{})
   303  	pulumi.RegisterOutputType(RoleAliasArrayOutput{})
   304  	pulumi.RegisterOutputType(RoleAliasMapOutput{})
   305  }