github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53/cidrCollection.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 route53
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides a Route53 CIDR collection resource.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := route53.NewCidrCollection(ctx, "example", &route53.CidrCollectionArgs{
    32  //				Name: pulumi.String("collection-1"),
    33  //			})
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  //
    44  // ## Import
    45  //
    46  // Using `pulumi import`, import CIDR collections using their ID. For example:
    47  //
    48  // ```sh
    49  // $ pulumi import aws:route53/cidrCollection:CidrCollection example 9ac32814-3e67-0932-6048-8d779cc6f511
    50  // ```
    51  type CidrCollection struct {
    52  	pulumi.CustomResourceState
    53  
    54  	// The Amazon Resource Name (ARN) of the CIDR collection.
    55  	Arn pulumi.StringOutput `pulumi:"arn"`
    56  	// Unique name for the CIDR collection.
    57  	Name pulumi.StringOutput `pulumi:"name"`
    58  	// The lastest version of the CIDR collection.
    59  	Version pulumi.IntOutput `pulumi:"version"`
    60  }
    61  
    62  // NewCidrCollection registers a new resource with the given unique name, arguments, and options.
    63  func NewCidrCollection(ctx *pulumi.Context,
    64  	name string, args *CidrCollectionArgs, opts ...pulumi.ResourceOption) (*CidrCollection, error) {
    65  	if args == nil {
    66  		args = &CidrCollectionArgs{}
    67  	}
    68  
    69  	opts = internal.PkgResourceDefaultOpts(opts)
    70  	var resource CidrCollection
    71  	err := ctx.RegisterResource("aws:route53/cidrCollection:CidrCollection", name, args, &resource, opts...)
    72  	if err != nil {
    73  		return nil, err
    74  	}
    75  	return &resource, nil
    76  }
    77  
    78  // GetCidrCollection gets an existing CidrCollection resource's state with the given name, ID, and optional
    79  // state properties that are used to uniquely qualify the lookup (nil if not required).
    80  func GetCidrCollection(ctx *pulumi.Context,
    81  	name string, id pulumi.IDInput, state *CidrCollectionState, opts ...pulumi.ResourceOption) (*CidrCollection, error) {
    82  	var resource CidrCollection
    83  	err := ctx.ReadResource("aws:route53/cidrCollection:CidrCollection", name, id, state, &resource, opts...)
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return &resource, nil
    88  }
    89  
    90  // Input properties used for looking up and filtering CidrCollection resources.
    91  type cidrCollectionState struct {
    92  	// The Amazon Resource Name (ARN) of the CIDR collection.
    93  	Arn *string `pulumi:"arn"`
    94  	// Unique name for the CIDR collection.
    95  	Name *string `pulumi:"name"`
    96  	// The lastest version of the CIDR collection.
    97  	Version *int `pulumi:"version"`
    98  }
    99  
   100  type CidrCollectionState struct {
   101  	// The Amazon Resource Name (ARN) of the CIDR collection.
   102  	Arn pulumi.StringPtrInput
   103  	// Unique name for the CIDR collection.
   104  	Name pulumi.StringPtrInput
   105  	// The lastest version of the CIDR collection.
   106  	Version pulumi.IntPtrInput
   107  }
   108  
   109  func (CidrCollectionState) ElementType() reflect.Type {
   110  	return reflect.TypeOf((*cidrCollectionState)(nil)).Elem()
   111  }
   112  
   113  type cidrCollectionArgs struct {
   114  	// Unique name for the CIDR collection.
   115  	Name *string `pulumi:"name"`
   116  }
   117  
   118  // The set of arguments for constructing a CidrCollection resource.
   119  type CidrCollectionArgs struct {
   120  	// Unique name for the CIDR collection.
   121  	Name pulumi.StringPtrInput
   122  }
   123  
   124  func (CidrCollectionArgs) ElementType() reflect.Type {
   125  	return reflect.TypeOf((*cidrCollectionArgs)(nil)).Elem()
   126  }
   127  
   128  type CidrCollectionInput interface {
   129  	pulumi.Input
   130  
   131  	ToCidrCollectionOutput() CidrCollectionOutput
   132  	ToCidrCollectionOutputWithContext(ctx context.Context) CidrCollectionOutput
   133  }
   134  
   135  func (*CidrCollection) ElementType() reflect.Type {
   136  	return reflect.TypeOf((**CidrCollection)(nil)).Elem()
   137  }
   138  
   139  func (i *CidrCollection) ToCidrCollectionOutput() CidrCollectionOutput {
   140  	return i.ToCidrCollectionOutputWithContext(context.Background())
   141  }
   142  
   143  func (i *CidrCollection) ToCidrCollectionOutputWithContext(ctx context.Context) CidrCollectionOutput {
   144  	return pulumi.ToOutputWithContext(ctx, i).(CidrCollectionOutput)
   145  }
   146  
   147  // CidrCollectionArrayInput is an input type that accepts CidrCollectionArray and CidrCollectionArrayOutput values.
   148  // You can construct a concrete instance of `CidrCollectionArrayInput` via:
   149  //
   150  //	CidrCollectionArray{ CidrCollectionArgs{...} }
   151  type CidrCollectionArrayInput interface {
   152  	pulumi.Input
   153  
   154  	ToCidrCollectionArrayOutput() CidrCollectionArrayOutput
   155  	ToCidrCollectionArrayOutputWithContext(context.Context) CidrCollectionArrayOutput
   156  }
   157  
   158  type CidrCollectionArray []CidrCollectionInput
   159  
   160  func (CidrCollectionArray) ElementType() reflect.Type {
   161  	return reflect.TypeOf((*[]*CidrCollection)(nil)).Elem()
   162  }
   163  
   164  func (i CidrCollectionArray) ToCidrCollectionArrayOutput() CidrCollectionArrayOutput {
   165  	return i.ToCidrCollectionArrayOutputWithContext(context.Background())
   166  }
   167  
   168  func (i CidrCollectionArray) ToCidrCollectionArrayOutputWithContext(ctx context.Context) CidrCollectionArrayOutput {
   169  	return pulumi.ToOutputWithContext(ctx, i).(CidrCollectionArrayOutput)
   170  }
   171  
   172  // CidrCollectionMapInput is an input type that accepts CidrCollectionMap and CidrCollectionMapOutput values.
   173  // You can construct a concrete instance of `CidrCollectionMapInput` via:
   174  //
   175  //	CidrCollectionMap{ "key": CidrCollectionArgs{...} }
   176  type CidrCollectionMapInput interface {
   177  	pulumi.Input
   178  
   179  	ToCidrCollectionMapOutput() CidrCollectionMapOutput
   180  	ToCidrCollectionMapOutputWithContext(context.Context) CidrCollectionMapOutput
   181  }
   182  
   183  type CidrCollectionMap map[string]CidrCollectionInput
   184  
   185  func (CidrCollectionMap) ElementType() reflect.Type {
   186  	return reflect.TypeOf((*map[string]*CidrCollection)(nil)).Elem()
   187  }
   188  
   189  func (i CidrCollectionMap) ToCidrCollectionMapOutput() CidrCollectionMapOutput {
   190  	return i.ToCidrCollectionMapOutputWithContext(context.Background())
   191  }
   192  
   193  func (i CidrCollectionMap) ToCidrCollectionMapOutputWithContext(ctx context.Context) CidrCollectionMapOutput {
   194  	return pulumi.ToOutputWithContext(ctx, i).(CidrCollectionMapOutput)
   195  }
   196  
   197  type CidrCollectionOutput struct{ *pulumi.OutputState }
   198  
   199  func (CidrCollectionOutput) ElementType() reflect.Type {
   200  	return reflect.TypeOf((**CidrCollection)(nil)).Elem()
   201  }
   202  
   203  func (o CidrCollectionOutput) ToCidrCollectionOutput() CidrCollectionOutput {
   204  	return o
   205  }
   206  
   207  func (o CidrCollectionOutput) ToCidrCollectionOutputWithContext(ctx context.Context) CidrCollectionOutput {
   208  	return o
   209  }
   210  
   211  // The Amazon Resource Name (ARN) of the CIDR collection.
   212  func (o CidrCollectionOutput) Arn() pulumi.StringOutput {
   213  	return o.ApplyT(func(v *CidrCollection) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   214  }
   215  
   216  // Unique name for the CIDR collection.
   217  func (o CidrCollectionOutput) Name() pulumi.StringOutput {
   218  	return o.ApplyT(func(v *CidrCollection) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   219  }
   220  
   221  // The lastest version of the CIDR collection.
   222  func (o CidrCollectionOutput) Version() pulumi.IntOutput {
   223  	return o.ApplyT(func(v *CidrCollection) pulumi.IntOutput { return v.Version }).(pulumi.IntOutput)
   224  }
   225  
   226  type CidrCollectionArrayOutput struct{ *pulumi.OutputState }
   227  
   228  func (CidrCollectionArrayOutput) ElementType() reflect.Type {
   229  	return reflect.TypeOf((*[]*CidrCollection)(nil)).Elem()
   230  }
   231  
   232  func (o CidrCollectionArrayOutput) ToCidrCollectionArrayOutput() CidrCollectionArrayOutput {
   233  	return o
   234  }
   235  
   236  func (o CidrCollectionArrayOutput) ToCidrCollectionArrayOutputWithContext(ctx context.Context) CidrCollectionArrayOutput {
   237  	return o
   238  }
   239  
   240  func (o CidrCollectionArrayOutput) Index(i pulumi.IntInput) CidrCollectionOutput {
   241  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CidrCollection {
   242  		return vs[0].([]*CidrCollection)[vs[1].(int)]
   243  	}).(CidrCollectionOutput)
   244  }
   245  
   246  type CidrCollectionMapOutput struct{ *pulumi.OutputState }
   247  
   248  func (CidrCollectionMapOutput) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*map[string]*CidrCollection)(nil)).Elem()
   250  }
   251  
   252  func (o CidrCollectionMapOutput) ToCidrCollectionMapOutput() CidrCollectionMapOutput {
   253  	return o
   254  }
   255  
   256  func (o CidrCollectionMapOutput) ToCidrCollectionMapOutputWithContext(ctx context.Context) CidrCollectionMapOutput {
   257  	return o
   258  }
   259  
   260  func (o CidrCollectionMapOutput) MapIndex(k pulumi.StringInput) CidrCollectionOutput {
   261  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CidrCollection {
   262  		return vs[0].(map[string]*CidrCollection)[vs[1].(string)]
   263  	}).(CidrCollectionOutput)
   264  }
   265  
   266  func init() {
   267  	pulumi.RegisterInputType(reflect.TypeOf((*CidrCollectionInput)(nil)).Elem(), &CidrCollection{})
   268  	pulumi.RegisterInputType(reflect.TypeOf((*CidrCollectionArrayInput)(nil)).Elem(), CidrCollectionArray{})
   269  	pulumi.RegisterInputType(reflect.TypeOf((*CidrCollectionMapInput)(nil)).Elem(), CidrCollectionMap{})
   270  	pulumi.RegisterOutputType(CidrCollectionOutput{})
   271  	pulumi.RegisterOutputType(CidrCollectionArrayOutput{})
   272  	pulumi.RegisterOutputType(CidrCollectionMapOutput{})
   273  }