github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/vpcIpamScope.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 ec2
     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  // Creates a scope for AWS IPAM.
    16  //
    17  // ## Example Usage
    18  //
    19  // Basic usage:
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			current, err := aws.GetRegion(ctx, nil, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			example, err := ec2.NewVpcIpam(ctx, "example", &ec2.VpcIpamArgs{
    40  //				OperatingRegions: ec2.VpcIpamOperatingRegionArray{
    41  //					&ec2.VpcIpamOperatingRegionArgs{
    42  //						RegionName: pulumi.String(current.Name),
    43  //					},
    44  //				},
    45  //			})
    46  //			if err != nil {
    47  //				return err
    48  //			}
    49  //			_, err = ec2.NewVpcIpamScope(ctx, "example", &ec2.VpcIpamScopeArgs{
    50  //				IpamId:      example.ID(),
    51  //				Description: pulumi.String("Another Scope"),
    52  //			})
    53  //			if err != nil {
    54  //				return err
    55  //			}
    56  //			return nil
    57  //		})
    58  //	}
    59  //
    60  // ```
    61  // <!--End PulumiCodeChooser -->
    62  //
    63  // ## Import
    64  //
    65  // Using `pulumi import`, import IPAMs using the `scope_id`. For example:
    66  //
    67  // ```sh
    68  // $ pulumi import aws:ec2/vpcIpamScope:VpcIpamScope example ipam-scope-0513c69f283d11dfb
    69  // ```
    70  type VpcIpamScope struct {
    71  	pulumi.CustomResourceState
    72  
    73  	// The Amazon Resource Name (ARN) of the scope.
    74  	Arn pulumi.StringOutput `pulumi:"arn"`
    75  	// A description for the scope you're creating.
    76  	Description pulumi.StringPtrOutput `pulumi:"description"`
    77  	// The ARN of the IPAM for which you're creating this scope.
    78  	IpamArn pulumi.StringOutput `pulumi:"ipamArn"`
    79  	// The ID of the IPAM for which you're creating this scope.
    80  	IpamId        pulumi.StringOutput `pulumi:"ipamId"`
    81  	IpamScopeType pulumi.StringOutput `pulumi:"ipamScopeType"`
    82  	// Defines if the scope is the default scope or not.
    83  	IsDefault pulumi.BoolOutput `pulumi:"isDefault"`
    84  	// The number of pools in the scope.
    85  	PoolCount pulumi.IntOutput `pulumi:"poolCount"`
    86  	// 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.
    87  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    88  	// Deprecated: Please use `tags` instead.
    89  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    90  }
    91  
    92  // NewVpcIpamScope registers a new resource with the given unique name, arguments, and options.
    93  func NewVpcIpamScope(ctx *pulumi.Context,
    94  	name string, args *VpcIpamScopeArgs, opts ...pulumi.ResourceOption) (*VpcIpamScope, error) {
    95  	if args == nil {
    96  		return nil, errors.New("missing one or more required arguments")
    97  	}
    98  
    99  	if args.IpamId == nil {
   100  		return nil, errors.New("invalid value for required argument 'IpamId'")
   101  	}
   102  	opts = internal.PkgResourceDefaultOpts(opts)
   103  	var resource VpcIpamScope
   104  	err := ctx.RegisterResource("aws:ec2/vpcIpamScope:VpcIpamScope", name, args, &resource, opts...)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return &resource, nil
   109  }
   110  
   111  // GetVpcIpamScope gets an existing VpcIpamScope resource's state with the given name, ID, and optional
   112  // state properties that are used to uniquely qualify the lookup (nil if not required).
   113  func GetVpcIpamScope(ctx *pulumi.Context,
   114  	name string, id pulumi.IDInput, state *VpcIpamScopeState, opts ...pulumi.ResourceOption) (*VpcIpamScope, error) {
   115  	var resource VpcIpamScope
   116  	err := ctx.ReadResource("aws:ec2/vpcIpamScope:VpcIpamScope", name, id, state, &resource, opts...)
   117  	if err != nil {
   118  		return nil, err
   119  	}
   120  	return &resource, nil
   121  }
   122  
   123  // Input properties used for looking up and filtering VpcIpamScope resources.
   124  type vpcIpamScopeState struct {
   125  	// The Amazon Resource Name (ARN) of the scope.
   126  	Arn *string `pulumi:"arn"`
   127  	// A description for the scope you're creating.
   128  	Description *string `pulumi:"description"`
   129  	// The ARN of the IPAM for which you're creating this scope.
   130  	IpamArn *string `pulumi:"ipamArn"`
   131  	// The ID of the IPAM for which you're creating this scope.
   132  	IpamId        *string `pulumi:"ipamId"`
   133  	IpamScopeType *string `pulumi:"ipamScopeType"`
   134  	// Defines if the scope is the default scope or not.
   135  	IsDefault *bool `pulumi:"isDefault"`
   136  	// The number of pools in the scope.
   137  	PoolCount *int `pulumi:"poolCount"`
   138  	// 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.
   139  	Tags map[string]string `pulumi:"tags"`
   140  	// Deprecated: Please use `tags` instead.
   141  	TagsAll map[string]string `pulumi:"tagsAll"`
   142  }
   143  
   144  type VpcIpamScopeState struct {
   145  	// The Amazon Resource Name (ARN) of the scope.
   146  	Arn pulumi.StringPtrInput
   147  	// A description for the scope you're creating.
   148  	Description pulumi.StringPtrInput
   149  	// The ARN of the IPAM for which you're creating this scope.
   150  	IpamArn pulumi.StringPtrInput
   151  	// The ID of the IPAM for which you're creating this scope.
   152  	IpamId        pulumi.StringPtrInput
   153  	IpamScopeType pulumi.StringPtrInput
   154  	// Defines if the scope is the default scope or not.
   155  	IsDefault pulumi.BoolPtrInput
   156  	// The number of pools in the scope.
   157  	PoolCount pulumi.IntPtrInput
   158  	// 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.
   159  	Tags pulumi.StringMapInput
   160  	// Deprecated: Please use `tags` instead.
   161  	TagsAll pulumi.StringMapInput
   162  }
   163  
   164  func (VpcIpamScopeState) ElementType() reflect.Type {
   165  	return reflect.TypeOf((*vpcIpamScopeState)(nil)).Elem()
   166  }
   167  
   168  type vpcIpamScopeArgs struct {
   169  	// A description for the scope you're creating.
   170  	Description *string `pulumi:"description"`
   171  	// The ID of the IPAM for which you're creating this scope.
   172  	IpamId string `pulumi:"ipamId"`
   173  	// 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.
   174  	Tags map[string]string `pulumi:"tags"`
   175  }
   176  
   177  // The set of arguments for constructing a VpcIpamScope resource.
   178  type VpcIpamScopeArgs struct {
   179  	// A description for the scope you're creating.
   180  	Description pulumi.StringPtrInput
   181  	// The ID of the IPAM for which you're creating this scope.
   182  	IpamId pulumi.StringInput
   183  	// 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.
   184  	Tags pulumi.StringMapInput
   185  }
   186  
   187  func (VpcIpamScopeArgs) ElementType() reflect.Type {
   188  	return reflect.TypeOf((*vpcIpamScopeArgs)(nil)).Elem()
   189  }
   190  
   191  type VpcIpamScopeInput interface {
   192  	pulumi.Input
   193  
   194  	ToVpcIpamScopeOutput() VpcIpamScopeOutput
   195  	ToVpcIpamScopeOutputWithContext(ctx context.Context) VpcIpamScopeOutput
   196  }
   197  
   198  func (*VpcIpamScope) ElementType() reflect.Type {
   199  	return reflect.TypeOf((**VpcIpamScope)(nil)).Elem()
   200  }
   201  
   202  func (i *VpcIpamScope) ToVpcIpamScopeOutput() VpcIpamScopeOutput {
   203  	return i.ToVpcIpamScopeOutputWithContext(context.Background())
   204  }
   205  
   206  func (i *VpcIpamScope) ToVpcIpamScopeOutputWithContext(ctx context.Context) VpcIpamScopeOutput {
   207  	return pulumi.ToOutputWithContext(ctx, i).(VpcIpamScopeOutput)
   208  }
   209  
   210  // VpcIpamScopeArrayInput is an input type that accepts VpcIpamScopeArray and VpcIpamScopeArrayOutput values.
   211  // You can construct a concrete instance of `VpcIpamScopeArrayInput` via:
   212  //
   213  //	VpcIpamScopeArray{ VpcIpamScopeArgs{...} }
   214  type VpcIpamScopeArrayInput interface {
   215  	pulumi.Input
   216  
   217  	ToVpcIpamScopeArrayOutput() VpcIpamScopeArrayOutput
   218  	ToVpcIpamScopeArrayOutputWithContext(context.Context) VpcIpamScopeArrayOutput
   219  }
   220  
   221  type VpcIpamScopeArray []VpcIpamScopeInput
   222  
   223  func (VpcIpamScopeArray) ElementType() reflect.Type {
   224  	return reflect.TypeOf((*[]*VpcIpamScope)(nil)).Elem()
   225  }
   226  
   227  func (i VpcIpamScopeArray) ToVpcIpamScopeArrayOutput() VpcIpamScopeArrayOutput {
   228  	return i.ToVpcIpamScopeArrayOutputWithContext(context.Background())
   229  }
   230  
   231  func (i VpcIpamScopeArray) ToVpcIpamScopeArrayOutputWithContext(ctx context.Context) VpcIpamScopeArrayOutput {
   232  	return pulumi.ToOutputWithContext(ctx, i).(VpcIpamScopeArrayOutput)
   233  }
   234  
   235  // VpcIpamScopeMapInput is an input type that accepts VpcIpamScopeMap and VpcIpamScopeMapOutput values.
   236  // You can construct a concrete instance of `VpcIpamScopeMapInput` via:
   237  //
   238  //	VpcIpamScopeMap{ "key": VpcIpamScopeArgs{...} }
   239  type VpcIpamScopeMapInput interface {
   240  	pulumi.Input
   241  
   242  	ToVpcIpamScopeMapOutput() VpcIpamScopeMapOutput
   243  	ToVpcIpamScopeMapOutputWithContext(context.Context) VpcIpamScopeMapOutput
   244  }
   245  
   246  type VpcIpamScopeMap map[string]VpcIpamScopeInput
   247  
   248  func (VpcIpamScopeMap) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*map[string]*VpcIpamScope)(nil)).Elem()
   250  }
   251  
   252  func (i VpcIpamScopeMap) ToVpcIpamScopeMapOutput() VpcIpamScopeMapOutput {
   253  	return i.ToVpcIpamScopeMapOutputWithContext(context.Background())
   254  }
   255  
   256  func (i VpcIpamScopeMap) ToVpcIpamScopeMapOutputWithContext(ctx context.Context) VpcIpamScopeMapOutput {
   257  	return pulumi.ToOutputWithContext(ctx, i).(VpcIpamScopeMapOutput)
   258  }
   259  
   260  type VpcIpamScopeOutput struct{ *pulumi.OutputState }
   261  
   262  func (VpcIpamScopeOutput) ElementType() reflect.Type {
   263  	return reflect.TypeOf((**VpcIpamScope)(nil)).Elem()
   264  }
   265  
   266  func (o VpcIpamScopeOutput) ToVpcIpamScopeOutput() VpcIpamScopeOutput {
   267  	return o
   268  }
   269  
   270  func (o VpcIpamScopeOutput) ToVpcIpamScopeOutputWithContext(ctx context.Context) VpcIpamScopeOutput {
   271  	return o
   272  }
   273  
   274  // The Amazon Resource Name (ARN) of the scope.
   275  func (o VpcIpamScopeOutput) Arn() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *VpcIpamScope) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   277  }
   278  
   279  // A description for the scope you're creating.
   280  func (o VpcIpamScopeOutput) Description() pulumi.StringPtrOutput {
   281  	return o.ApplyT(func(v *VpcIpamScope) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   282  }
   283  
   284  // The ARN of the IPAM for which you're creating this scope.
   285  func (o VpcIpamScopeOutput) IpamArn() pulumi.StringOutput {
   286  	return o.ApplyT(func(v *VpcIpamScope) pulumi.StringOutput { return v.IpamArn }).(pulumi.StringOutput)
   287  }
   288  
   289  // The ID of the IPAM for which you're creating this scope.
   290  func (o VpcIpamScopeOutput) IpamId() pulumi.StringOutput {
   291  	return o.ApplyT(func(v *VpcIpamScope) pulumi.StringOutput { return v.IpamId }).(pulumi.StringOutput)
   292  }
   293  
   294  func (o VpcIpamScopeOutput) IpamScopeType() pulumi.StringOutput {
   295  	return o.ApplyT(func(v *VpcIpamScope) pulumi.StringOutput { return v.IpamScopeType }).(pulumi.StringOutput)
   296  }
   297  
   298  // Defines if the scope is the default scope or not.
   299  func (o VpcIpamScopeOutput) IsDefault() pulumi.BoolOutput {
   300  	return o.ApplyT(func(v *VpcIpamScope) pulumi.BoolOutput { return v.IsDefault }).(pulumi.BoolOutput)
   301  }
   302  
   303  // The number of pools in the scope.
   304  func (o VpcIpamScopeOutput) PoolCount() pulumi.IntOutput {
   305  	return o.ApplyT(func(v *VpcIpamScope) pulumi.IntOutput { return v.PoolCount }).(pulumi.IntOutput)
   306  }
   307  
   308  // 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.
   309  func (o VpcIpamScopeOutput) Tags() pulumi.StringMapOutput {
   310  	return o.ApplyT(func(v *VpcIpamScope) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   311  }
   312  
   313  // Deprecated: Please use `tags` instead.
   314  func (o VpcIpamScopeOutput) TagsAll() pulumi.StringMapOutput {
   315  	return o.ApplyT(func(v *VpcIpamScope) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   316  }
   317  
   318  type VpcIpamScopeArrayOutput struct{ *pulumi.OutputState }
   319  
   320  func (VpcIpamScopeArrayOutput) ElementType() reflect.Type {
   321  	return reflect.TypeOf((*[]*VpcIpamScope)(nil)).Elem()
   322  }
   323  
   324  func (o VpcIpamScopeArrayOutput) ToVpcIpamScopeArrayOutput() VpcIpamScopeArrayOutput {
   325  	return o
   326  }
   327  
   328  func (o VpcIpamScopeArrayOutput) ToVpcIpamScopeArrayOutputWithContext(ctx context.Context) VpcIpamScopeArrayOutput {
   329  	return o
   330  }
   331  
   332  func (o VpcIpamScopeArrayOutput) Index(i pulumi.IntInput) VpcIpamScopeOutput {
   333  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VpcIpamScope {
   334  		return vs[0].([]*VpcIpamScope)[vs[1].(int)]
   335  	}).(VpcIpamScopeOutput)
   336  }
   337  
   338  type VpcIpamScopeMapOutput struct{ *pulumi.OutputState }
   339  
   340  func (VpcIpamScopeMapOutput) ElementType() reflect.Type {
   341  	return reflect.TypeOf((*map[string]*VpcIpamScope)(nil)).Elem()
   342  }
   343  
   344  func (o VpcIpamScopeMapOutput) ToVpcIpamScopeMapOutput() VpcIpamScopeMapOutput {
   345  	return o
   346  }
   347  
   348  func (o VpcIpamScopeMapOutput) ToVpcIpamScopeMapOutputWithContext(ctx context.Context) VpcIpamScopeMapOutput {
   349  	return o
   350  }
   351  
   352  func (o VpcIpamScopeMapOutput) MapIndex(k pulumi.StringInput) VpcIpamScopeOutput {
   353  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VpcIpamScope {
   354  		return vs[0].(map[string]*VpcIpamScope)[vs[1].(string)]
   355  	}).(VpcIpamScopeOutput)
   356  }
   357  
   358  func init() {
   359  	pulumi.RegisterInputType(reflect.TypeOf((*VpcIpamScopeInput)(nil)).Elem(), &VpcIpamScope{})
   360  	pulumi.RegisterInputType(reflect.TypeOf((*VpcIpamScopeArrayInput)(nil)).Elem(), VpcIpamScopeArray{})
   361  	pulumi.RegisterInputType(reflect.TypeOf((*VpcIpamScopeMapInput)(nil)).Elem(), VpcIpamScopeMap{})
   362  	pulumi.RegisterOutputType(VpcIpamScopeOutput{})
   363  	pulumi.RegisterOutputType(VpcIpamScopeArrayOutput{})
   364  	pulumi.RegisterOutputType(VpcIpamScopeMapOutput{})
   365  }