github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/iam/accountAlias.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 iam
     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  // > **Note:** There is only a single account alias per AWS account.
    16  //
    17  // Manages the account alias for the AWS Account.
    18  //
    19  // ## Example Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := iam.NewAccountAlias(ctx, "alias", &iam.AccountAliasArgs{
    35  //				AccountAlias: pulumi.String("my-account-alias"),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // ## Import
    48  //
    49  // Using `pulumi import`, import the current Account Alias using the `account_alias`. For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:iam/accountAlias:AccountAlias alias my-account-alias
    53  // ```
    54  type AccountAlias struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// The account alias
    58  	AccountAlias pulumi.StringOutput `pulumi:"accountAlias"`
    59  }
    60  
    61  // NewAccountAlias registers a new resource with the given unique name, arguments, and options.
    62  func NewAccountAlias(ctx *pulumi.Context,
    63  	name string, args *AccountAliasArgs, opts ...pulumi.ResourceOption) (*AccountAlias, error) {
    64  	if args == nil {
    65  		return nil, errors.New("missing one or more required arguments")
    66  	}
    67  
    68  	if args.AccountAlias == nil {
    69  		return nil, errors.New("invalid value for required argument 'AccountAlias'")
    70  	}
    71  	opts = internal.PkgResourceDefaultOpts(opts)
    72  	var resource AccountAlias
    73  	err := ctx.RegisterResource("aws:iam/accountAlias:AccountAlias", name, args, &resource, opts...)
    74  	if err != nil {
    75  		return nil, err
    76  	}
    77  	return &resource, nil
    78  }
    79  
    80  // GetAccountAlias gets an existing AccountAlias resource's state with the given name, ID, and optional
    81  // state properties that are used to uniquely qualify the lookup (nil if not required).
    82  func GetAccountAlias(ctx *pulumi.Context,
    83  	name string, id pulumi.IDInput, state *AccountAliasState, opts ...pulumi.ResourceOption) (*AccountAlias, error) {
    84  	var resource AccountAlias
    85  	err := ctx.ReadResource("aws:iam/accountAlias:AccountAlias", name, id, state, &resource, opts...)
    86  	if err != nil {
    87  		return nil, err
    88  	}
    89  	return &resource, nil
    90  }
    91  
    92  // Input properties used for looking up and filtering AccountAlias resources.
    93  type accountAliasState struct {
    94  	// The account alias
    95  	AccountAlias *string `pulumi:"accountAlias"`
    96  }
    97  
    98  type AccountAliasState struct {
    99  	// The account alias
   100  	AccountAlias pulumi.StringPtrInput
   101  }
   102  
   103  func (AccountAliasState) ElementType() reflect.Type {
   104  	return reflect.TypeOf((*accountAliasState)(nil)).Elem()
   105  }
   106  
   107  type accountAliasArgs struct {
   108  	// The account alias
   109  	AccountAlias string `pulumi:"accountAlias"`
   110  }
   111  
   112  // The set of arguments for constructing a AccountAlias resource.
   113  type AccountAliasArgs struct {
   114  	// The account alias
   115  	AccountAlias pulumi.StringInput
   116  }
   117  
   118  func (AccountAliasArgs) ElementType() reflect.Type {
   119  	return reflect.TypeOf((*accountAliasArgs)(nil)).Elem()
   120  }
   121  
   122  type AccountAliasInput interface {
   123  	pulumi.Input
   124  
   125  	ToAccountAliasOutput() AccountAliasOutput
   126  	ToAccountAliasOutputWithContext(ctx context.Context) AccountAliasOutput
   127  }
   128  
   129  func (*AccountAlias) ElementType() reflect.Type {
   130  	return reflect.TypeOf((**AccountAlias)(nil)).Elem()
   131  }
   132  
   133  func (i *AccountAlias) ToAccountAliasOutput() AccountAliasOutput {
   134  	return i.ToAccountAliasOutputWithContext(context.Background())
   135  }
   136  
   137  func (i *AccountAlias) ToAccountAliasOutputWithContext(ctx context.Context) AccountAliasOutput {
   138  	return pulumi.ToOutputWithContext(ctx, i).(AccountAliasOutput)
   139  }
   140  
   141  // AccountAliasArrayInput is an input type that accepts AccountAliasArray and AccountAliasArrayOutput values.
   142  // You can construct a concrete instance of `AccountAliasArrayInput` via:
   143  //
   144  //	AccountAliasArray{ AccountAliasArgs{...} }
   145  type AccountAliasArrayInput interface {
   146  	pulumi.Input
   147  
   148  	ToAccountAliasArrayOutput() AccountAliasArrayOutput
   149  	ToAccountAliasArrayOutputWithContext(context.Context) AccountAliasArrayOutput
   150  }
   151  
   152  type AccountAliasArray []AccountAliasInput
   153  
   154  func (AccountAliasArray) ElementType() reflect.Type {
   155  	return reflect.TypeOf((*[]*AccountAlias)(nil)).Elem()
   156  }
   157  
   158  func (i AccountAliasArray) ToAccountAliasArrayOutput() AccountAliasArrayOutput {
   159  	return i.ToAccountAliasArrayOutputWithContext(context.Background())
   160  }
   161  
   162  func (i AccountAliasArray) ToAccountAliasArrayOutputWithContext(ctx context.Context) AccountAliasArrayOutput {
   163  	return pulumi.ToOutputWithContext(ctx, i).(AccountAliasArrayOutput)
   164  }
   165  
   166  // AccountAliasMapInput is an input type that accepts AccountAliasMap and AccountAliasMapOutput values.
   167  // You can construct a concrete instance of `AccountAliasMapInput` via:
   168  //
   169  //	AccountAliasMap{ "key": AccountAliasArgs{...} }
   170  type AccountAliasMapInput interface {
   171  	pulumi.Input
   172  
   173  	ToAccountAliasMapOutput() AccountAliasMapOutput
   174  	ToAccountAliasMapOutputWithContext(context.Context) AccountAliasMapOutput
   175  }
   176  
   177  type AccountAliasMap map[string]AccountAliasInput
   178  
   179  func (AccountAliasMap) ElementType() reflect.Type {
   180  	return reflect.TypeOf((*map[string]*AccountAlias)(nil)).Elem()
   181  }
   182  
   183  func (i AccountAliasMap) ToAccountAliasMapOutput() AccountAliasMapOutput {
   184  	return i.ToAccountAliasMapOutputWithContext(context.Background())
   185  }
   186  
   187  func (i AccountAliasMap) ToAccountAliasMapOutputWithContext(ctx context.Context) AccountAliasMapOutput {
   188  	return pulumi.ToOutputWithContext(ctx, i).(AccountAliasMapOutput)
   189  }
   190  
   191  type AccountAliasOutput struct{ *pulumi.OutputState }
   192  
   193  func (AccountAliasOutput) ElementType() reflect.Type {
   194  	return reflect.TypeOf((**AccountAlias)(nil)).Elem()
   195  }
   196  
   197  func (o AccountAliasOutput) ToAccountAliasOutput() AccountAliasOutput {
   198  	return o
   199  }
   200  
   201  func (o AccountAliasOutput) ToAccountAliasOutputWithContext(ctx context.Context) AccountAliasOutput {
   202  	return o
   203  }
   204  
   205  // The account alias
   206  func (o AccountAliasOutput) AccountAlias() pulumi.StringOutput {
   207  	return o.ApplyT(func(v *AccountAlias) pulumi.StringOutput { return v.AccountAlias }).(pulumi.StringOutput)
   208  }
   209  
   210  type AccountAliasArrayOutput struct{ *pulumi.OutputState }
   211  
   212  func (AccountAliasArrayOutput) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*[]*AccountAlias)(nil)).Elem()
   214  }
   215  
   216  func (o AccountAliasArrayOutput) ToAccountAliasArrayOutput() AccountAliasArrayOutput {
   217  	return o
   218  }
   219  
   220  func (o AccountAliasArrayOutput) ToAccountAliasArrayOutputWithContext(ctx context.Context) AccountAliasArrayOutput {
   221  	return o
   222  }
   223  
   224  func (o AccountAliasArrayOutput) Index(i pulumi.IntInput) AccountAliasOutput {
   225  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AccountAlias {
   226  		return vs[0].([]*AccountAlias)[vs[1].(int)]
   227  	}).(AccountAliasOutput)
   228  }
   229  
   230  type AccountAliasMapOutput struct{ *pulumi.OutputState }
   231  
   232  func (AccountAliasMapOutput) ElementType() reflect.Type {
   233  	return reflect.TypeOf((*map[string]*AccountAlias)(nil)).Elem()
   234  }
   235  
   236  func (o AccountAliasMapOutput) ToAccountAliasMapOutput() AccountAliasMapOutput {
   237  	return o
   238  }
   239  
   240  func (o AccountAliasMapOutput) ToAccountAliasMapOutputWithContext(ctx context.Context) AccountAliasMapOutput {
   241  	return o
   242  }
   243  
   244  func (o AccountAliasMapOutput) MapIndex(k pulumi.StringInput) AccountAliasOutput {
   245  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AccountAlias {
   246  		return vs[0].(map[string]*AccountAlias)[vs[1].(string)]
   247  	}).(AccountAliasOutput)
   248  }
   249  
   250  func init() {
   251  	pulumi.RegisterInputType(reflect.TypeOf((*AccountAliasInput)(nil)).Elem(), &AccountAlias{})
   252  	pulumi.RegisterInputType(reflect.TypeOf((*AccountAliasArrayInput)(nil)).Elem(), AccountAliasArray{})
   253  	pulumi.RegisterInputType(reflect.TypeOf((*AccountAliasMapInput)(nil)).Elem(), AccountAliasMap{})
   254  	pulumi.RegisterOutputType(AccountAliasOutput{})
   255  	pulumi.RegisterOutputType(AccountAliasArrayOutput{})
   256  	pulumi.RegisterOutputType(AccountAliasMapOutput{})
   257  }