github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/carrierGateway.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 // Manages an EC2 Carrier Gateway. See the AWS [documentation](https://docs.aws.amazon.com/vpc/latest/userguide/Carrier_Gateway.html) for more information. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := ec2.NewCarrierGateway(ctx, "example", &ec2.CarrierGatewayArgs{ 33 // VpcId: pulumi.Any(exampleAwsVpc.Id), 34 // Tags: pulumi.StringMap{ 35 // "Name": pulumi.String("example-carrier-gateway"), 36 // }, 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import `aws_ec2_carrier_gateway` using the carrier gateway's ID. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:ec2/carrierGateway:CarrierGateway example cgw-12345 54 // ``` 55 type CarrierGateway struct { 56 pulumi.CustomResourceState 57 58 // The ARN of the carrier gateway. 59 Arn pulumi.StringOutput `pulumi:"arn"` 60 // The AWS account ID of the owner of the carrier gateway. 61 OwnerId pulumi.StringOutput `pulumi:"ownerId"` 62 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 63 Tags pulumi.StringMapOutput `pulumi:"tags"` 64 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 65 // 66 // Deprecated: Please use `tags` instead. 67 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 68 // The ID of the VPC to associate with the carrier gateway. 69 VpcId pulumi.StringOutput `pulumi:"vpcId"` 70 } 71 72 // NewCarrierGateway registers a new resource with the given unique name, arguments, and options. 73 func NewCarrierGateway(ctx *pulumi.Context, 74 name string, args *CarrierGatewayArgs, opts ...pulumi.ResourceOption) (*CarrierGateway, error) { 75 if args == nil { 76 return nil, errors.New("missing one or more required arguments") 77 } 78 79 if args.VpcId == nil { 80 return nil, errors.New("invalid value for required argument 'VpcId'") 81 } 82 opts = internal.PkgResourceDefaultOpts(opts) 83 var resource CarrierGateway 84 err := ctx.RegisterResource("aws:ec2/carrierGateway:CarrierGateway", name, args, &resource, opts...) 85 if err != nil { 86 return nil, err 87 } 88 return &resource, nil 89 } 90 91 // GetCarrierGateway gets an existing CarrierGateway resource's state with the given name, ID, and optional 92 // state properties that are used to uniquely qualify the lookup (nil if not required). 93 func GetCarrierGateway(ctx *pulumi.Context, 94 name string, id pulumi.IDInput, state *CarrierGatewayState, opts ...pulumi.ResourceOption) (*CarrierGateway, error) { 95 var resource CarrierGateway 96 err := ctx.ReadResource("aws:ec2/carrierGateway:CarrierGateway", name, id, state, &resource, opts...) 97 if err != nil { 98 return nil, err 99 } 100 return &resource, nil 101 } 102 103 // Input properties used for looking up and filtering CarrierGateway resources. 104 type carrierGatewayState struct { 105 // The ARN of the carrier gateway. 106 Arn *string `pulumi:"arn"` 107 // The AWS account ID of the owner of the carrier gateway. 108 OwnerId *string `pulumi:"ownerId"` 109 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 110 Tags map[string]string `pulumi:"tags"` 111 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 112 // 113 // Deprecated: Please use `tags` instead. 114 TagsAll map[string]string `pulumi:"tagsAll"` 115 // The ID of the VPC to associate with the carrier gateway. 116 VpcId *string `pulumi:"vpcId"` 117 } 118 119 type CarrierGatewayState struct { 120 // The ARN of the carrier gateway. 121 Arn pulumi.StringPtrInput 122 // The AWS account ID of the owner of the carrier gateway. 123 OwnerId pulumi.StringPtrInput 124 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 125 Tags pulumi.StringMapInput 126 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 127 // 128 // Deprecated: Please use `tags` instead. 129 TagsAll pulumi.StringMapInput 130 // The ID of the VPC to associate with the carrier gateway. 131 VpcId pulumi.StringPtrInput 132 } 133 134 func (CarrierGatewayState) ElementType() reflect.Type { 135 return reflect.TypeOf((*carrierGatewayState)(nil)).Elem() 136 } 137 138 type carrierGatewayArgs struct { 139 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 140 Tags map[string]string `pulumi:"tags"` 141 // The ID of the VPC to associate with the carrier gateway. 142 VpcId string `pulumi:"vpcId"` 143 } 144 145 // The set of arguments for constructing a CarrierGateway resource. 146 type CarrierGatewayArgs struct { 147 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 148 Tags pulumi.StringMapInput 149 // The ID of the VPC to associate with the carrier gateway. 150 VpcId pulumi.StringInput 151 } 152 153 func (CarrierGatewayArgs) ElementType() reflect.Type { 154 return reflect.TypeOf((*carrierGatewayArgs)(nil)).Elem() 155 } 156 157 type CarrierGatewayInput interface { 158 pulumi.Input 159 160 ToCarrierGatewayOutput() CarrierGatewayOutput 161 ToCarrierGatewayOutputWithContext(ctx context.Context) CarrierGatewayOutput 162 } 163 164 func (*CarrierGateway) ElementType() reflect.Type { 165 return reflect.TypeOf((**CarrierGateway)(nil)).Elem() 166 } 167 168 func (i *CarrierGateway) ToCarrierGatewayOutput() CarrierGatewayOutput { 169 return i.ToCarrierGatewayOutputWithContext(context.Background()) 170 } 171 172 func (i *CarrierGateway) ToCarrierGatewayOutputWithContext(ctx context.Context) CarrierGatewayOutput { 173 return pulumi.ToOutputWithContext(ctx, i).(CarrierGatewayOutput) 174 } 175 176 // CarrierGatewayArrayInput is an input type that accepts CarrierGatewayArray and CarrierGatewayArrayOutput values. 177 // You can construct a concrete instance of `CarrierGatewayArrayInput` via: 178 // 179 // CarrierGatewayArray{ CarrierGatewayArgs{...} } 180 type CarrierGatewayArrayInput interface { 181 pulumi.Input 182 183 ToCarrierGatewayArrayOutput() CarrierGatewayArrayOutput 184 ToCarrierGatewayArrayOutputWithContext(context.Context) CarrierGatewayArrayOutput 185 } 186 187 type CarrierGatewayArray []CarrierGatewayInput 188 189 func (CarrierGatewayArray) ElementType() reflect.Type { 190 return reflect.TypeOf((*[]*CarrierGateway)(nil)).Elem() 191 } 192 193 func (i CarrierGatewayArray) ToCarrierGatewayArrayOutput() CarrierGatewayArrayOutput { 194 return i.ToCarrierGatewayArrayOutputWithContext(context.Background()) 195 } 196 197 func (i CarrierGatewayArray) ToCarrierGatewayArrayOutputWithContext(ctx context.Context) CarrierGatewayArrayOutput { 198 return pulumi.ToOutputWithContext(ctx, i).(CarrierGatewayArrayOutput) 199 } 200 201 // CarrierGatewayMapInput is an input type that accepts CarrierGatewayMap and CarrierGatewayMapOutput values. 202 // You can construct a concrete instance of `CarrierGatewayMapInput` via: 203 // 204 // CarrierGatewayMap{ "key": CarrierGatewayArgs{...} } 205 type CarrierGatewayMapInput interface { 206 pulumi.Input 207 208 ToCarrierGatewayMapOutput() CarrierGatewayMapOutput 209 ToCarrierGatewayMapOutputWithContext(context.Context) CarrierGatewayMapOutput 210 } 211 212 type CarrierGatewayMap map[string]CarrierGatewayInput 213 214 func (CarrierGatewayMap) ElementType() reflect.Type { 215 return reflect.TypeOf((*map[string]*CarrierGateway)(nil)).Elem() 216 } 217 218 func (i CarrierGatewayMap) ToCarrierGatewayMapOutput() CarrierGatewayMapOutput { 219 return i.ToCarrierGatewayMapOutputWithContext(context.Background()) 220 } 221 222 func (i CarrierGatewayMap) ToCarrierGatewayMapOutputWithContext(ctx context.Context) CarrierGatewayMapOutput { 223 return pulumi.ToOutputWithContext(ctx, i).(CarrierGatewayMapOutput) 224 } 225 226 type CarrierGatewayOutput struct{ *pulumi.OutputState } 227 228 func (CarrierGatewayOutput) ElementType() reflect.Type { 229 return reflect.TypeOf((**CarrierGateway)(nil)).Elem() 230 } 231 232 func (o CarrierGatewayOutput) ToCarrierGatewayOutput() CarrierGatewayOutput { 233 return o 234 } 235 236 func (o CarrierGatewayOutput) ToCarrierGatewayOutputWithContext(ctx context.Context) CarrierGatewayOutput { 237 return o 238 } 239 240 // The ARN of the carrier gateway. 241 func (o CarrierGatewayOutput) Arn() pulumi.StringOutput { 242 return o.ApplyT(func(v *CarrierGateway) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 243 } 244 245 // The AWS account ID of the owner of the carrier gateway. 246 func (o CarrierGatewayOutput) OwnerId() pulumi.StringOutput { 247 return o.ApplyT(func(v *CarrierGateway) pulumi.StringOutput { return v.OwnerId }).(pulumi.StringOutput) 248 } 249 250 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 251 func (o CarrierGatewayOutput) Tags() pulumi.StringMapOutput { 252 return o.ApplyT(func(v *CarrierGateway) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 253 } 254 255 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 256 // 257 // Deprecated: Please use `tags` instead. 258 func (o CarrierGatewayOutput) TagsAll() pulumi.StringMapOutput { 259 return o.ApplyT(func(v *CarrierGateway) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 260 } 261 262 // The ID of the VPC to associate with the carrier gateway. 263 func (o CarrierGatewayOutput) VpcId() pulumi.StringOutput { 264 return o.ApplyT(func(v *CarrierGateway) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput) 265 } 266 267 type CarrierGatewayArrayOutput struct{ *pulumi.OutputState } 268 269 func (CarrierGatewayArrayOutput) ElementType() reflect.Type { 270 return reflect.TypeOf((*[]*CarrierGateway)(nil)).Elem() 271 } 272 273 func (o CarrierGatewayArrayOutput) ToCarrierGatewayArrayOutput() CarrierGatewayArrayOutput { 274 return o 275 } 276 277 func (o CarrierGatewayArrayOutput) ToCarrierGatewayArrayOutputWithContext(ctx context.Context) CarrierGatewayArrayOutput { 278 return o 279 } 280 281 func (o CarrierGatewayArrayOutput) Index(i pulumi.IntInput) CarrierGatewayOutput { 282 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CarrierGateway { 283 return vs[0].([]*CarrierGateway)[vs[1].(int)] 284 }).(CarrierGatewayOutput) 285 } 286 287 type CarrierGatewayMapOutput struct{ *pulumi.OutputState } 288 289 func (CarrierGatewayMapOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((*map[string]*CarrierGateway)(nil)).Elem() 291 } 292 293 func (o CarrierGatewayMapOutput) ToCarrierGatewayMapOutput() CarrierGatewayMapOutput { 294 return o 295 } 296 297 func (o CarrierGatewayMapOutput) ToCarrierGatewayMapOutputWithContext(ctx context.Context) CarrierGatewayMapOutput { 298 return o 299 } 300 301 func (o CarrierGatewayMapOutput) MapIndex(k pulumi.StringInput) CarrierGatewayOutput { 302 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CarrierGateway { 303 return vs[0].(map[string]*CarrierGateway)[vs[1].(string)] 304 }).(CarrierGatewayOutput) 305 } 306 307 func init() { 308 pulumi.RegisterInputType(reflect.TypeOf((*CarrierGatewayInput)(nil)).Elem(), &CarrierGateway{}) 309 pulumi.RegisterInputType(reflect.TypeOf((*CarrierGatewayArrayInput)(nil)).Elem(), CarrierGatewayArray{}) 310 pulumi.RegisterInputType(reflect.TypeOf((*CarrierGatewayMapInput)(nil)).Elem(), CarrierGatewayMap{}) 311 pulumi.RegisterOutputType(CarrierGatewayOutput{}) 312 pulumi.RegisterOutputType(CarrierGatewayArrayOutput{}) 313 pulumi.RegisterOutputType(CarrierGatewayMapOutput{}) 314 }