github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/egressOnlyInternetGateway.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 // [IPv6 only] Creates an egress-only Internet gateway for your VPC. 16 // An egress-only Internet gateway is used to enable outbound communication 17 // over IPv6 from instances in your VPC to the Internet, and prevents hosts 18 // outside of your VPC from initiating an IPv6 connection with your instance. 19 // 20 // ## Example Usage 21 // 22 // <!--Start PulumiCodeChooser --> 23 // ```go 24 // package main 25 // 26 // import ( 27 // 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 // example, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{ 36 // CidrBlock: pulumi.String("10.1.0.0/16"), 37 // AssignGeneratedIpv6CidrBlock: pulumi.Bool(true), 38 // }) 39 // if err != nil { 40 // return err 41 // } 42 // _, err = ec2.NewEgressOnlyInternetGateway(ctx, "example", &ec2.EgressOnlyInternetGatewayArgs{ 43 // VpcId: example.ID(), 44 // Tags: pulumi.StringMap{ 45 // "Name": pulumi.String("main"), 46 // }, 47 // }) 48 // if err != nil { 49 // return err 50 // } 51 // return nil 52 // }) 53 // } 54 // 55 // ``` 56 // <!--End PulumiCodeChooser --> 57 // 58 // ## Import 59 // 60 // Using `pulumi import`, import Egress-only Internet gateways using the `id`. For example: 61 // 62 // ```sh 63 // $ pulumi import aws:ec2/egressOnlyInternetGateway:EgressOnlyInternetGateway example eigw-015e0e244e24dfe8a 64 // ``` 65 type EgressOnlyInternetGateway struct { 66 pulumi.CustomResourceState 67 68 // 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. 69 Tags pulumi.StringMapOutput `pulumi:"tags"` 70 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 71 // 72 // Deprecated: Please use `tags` instead. 73 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 74 // The VPC ID to create in. 75 VpcId pulumi.StringOutput `pulumi:"vpcId"` 76 } 77 78 // NewEgressOnlyInternetGateway registers a new resource with the given unique name, arguments, and options. 79 func NewEgressOnlyInternetGateway(ctx *pulumi.Context, 80 name string, args *EgressOnlyInternetGatewayArgs, opts ...pulumi.ResourceOption) (*EgressOnlyInternetGateway, error) { 81 if args == nil { 82 return nil, errors.New("missing one or more required arguments") 83 } 84 85 if args.VpcId == nil { 86 return nil, errors.New("invalid value for required argument 'VpcId'") 87 } 88 opts = internal.PkgResourceDefaultOpts(opts) 89 var resource EgressOnlyInternetGateway 90 err := ctx.RegisterResource("aws:ec2/egressOnlyInternetGateway:EgressOnlyInternetGateway", name, args, &resource, opts...) 91 if err != nil { 92 return nil, err 93 } 94 return &resource, nil 95 } 96 97 // GetEgressOnlyInternetGateway gets an existing EgressOnlyInternetGateway resource's state with the given name, ID, and optional 98 // state properties that are used to uniquely qualify the lookup (nil if not required). 99 func GetEgressOnlyInternetGateway(ctx *pulumi.Context, 100 name string, id pulumi.IDInput, state *EgressOnlyInternetGatewayState, opts ...pulumi.ResourceOption) (*EgressOnlyInternetGateway, error) { 101 var resource EgressOnlyInternetGateway 102 err := ctx.ReadResource("aws:ec2/egressOnlyInternetGateway:EgressOnlyInternetGateway", name, id, state, &resource, opts...) 103 if err != nil { 104 return nil, err 105 } 106 return &resource, nil 107 } 108 109 // Input properties used for looking up and filtering EgressOnlyInternetGateway resources. 110 type egressOnlyInternetGatewayState struct { 111 // 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. 112 Tags map[string]string `pulumi:"tags"` 113 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 114 // 115 // Deprecated: Please use `tags` instead. 116 TagsAll map[string]string `pulumi:"tagsAll"` 117 // The VPC ID to create in. 118 VpcId *string `pulumi:"vpcId"` 119 } 120 121 type EgressOnlyInternetGatewayState struct { 122 // 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. 123 Tags pulumi.StringMapInput 124 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 125 // 126 // Deprecated: Please use `tags` instead. 127 TagsAll pulumi.StringMapInput 128 // The VPC ID to create in. 129 VpcId pulumi.StringPtrInput 130 } 131 132 func (EgressOnlyInternetGatewayState) ElementType() reflect.Type { 133 return reflect.TypeOf((*egressOnlyInternetGatewayState)(nil)).Elem() 134 } 135 136 type egressOnlyInternetGatewayArgs struct { 137 // 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. 138 Tags map[string]string `pulumi:"tags"` 139 // The VPC ID to create in. 140 VpcId string `pulumi:"vpcId"` 141 } 142 143 // The set of arguments for constructing a EgressOnlyInternetGateway resource. 144 type EgressOnlyInternetGatewayArgs struct { 145 // 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. 146 Tags pulumi.StringMapInput 147 // The VPC ID to create in. 148 VpcId pulumi.StringInput 149 } 150 151 func (EgressOnlyInternetGatewayArgs) ElementType() reflect.Type { 152 return reflect.TypeOf((*egressOnlyInternetGatewayArgs)(nil)).Elem() 153 } 154 155 type EgressOnlyInternetGatewayInput interface { 156 pulumi.Input 157 158 ToEgressOnlyInternetGatewayOutput() EgressOnlyInternetGatewayOutput 159 ToEgressOnlyInternetGatewayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayOutput 160 } 161 162 func (*EgressOnlyInternetGateway) ElementType() reflect.Type { 163 return reflect.TypeOf((**EgressOnlyInternetGateway)(nil)).Elem() 164 } 165 166 func (i *EgressOnlyInternetGateway) ToEgressOnlyInternetGatewayOutput() EgressOnlyInternetGatewayOutput { 167 return i.ToEgressOnlyInternetGatewayOutputWithContext(context.Background()) 168 } 169 170 func (i *EgressOnlyInternetGateway) ToEgressOnlyInternetGatewayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayOutput { 171 return pulumi.ToOutputWithContext(ctx, i).(EgressOnlyInternetGatewayOutput) 172 } 173 174 // EgressOnlyInternetGatewayArrayInput is an input type that accepts EgressOnlyInternetGatewayArray and EgressOnlyInternetGatewayArrayOutput values. 175 // You can construct a concrete instance of `EgressOnlyInternetGatewayArrayInput` via: 176 // 177 // EgressOnlyInternetGatewayArray{ EgressOnlyInternetGatewayArgs{...} } 178 type EgressOnlyInternetGatewayArrayInput interface { 179 pulumi.Input 180 181 ToEgressOnlyInternetGatewayArrayOutput() EgressOnlyInternetGatewayArrayOutput 182 ToEgressOnlyInternetGatewayArrayOutputWithContext(context.Context) EgressOnlyInternetGatewayArrayOutput 183 } 184 185 type EgressOnlyInternetGatewayArray []EgressOnlyInternetGatewayInput 186 187 func (EgressOnlyInternetGatewayArray) ElementType() reflect.Type { 188 return reflect.TypeOf((*[]*EgressOnlyInternetGateway)(nil)).Elem() 189 } 190 191 func (i EgressOnlyInternetGatewayArray) ToEgressOnlyInternetGatewayArrayOutput() EgressOnlyInternetGatewayArrayOutput { 192 return i.ToEgressOnlyInternetGatewayArrayOutputWithContext(context.Background()) 193 } 194 195 func (i EgressOnlyInternetGatewayArray) ToEgressOnlyInternetGatewayArrayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayArrayOutput { 196 return pulumi.ToOutputWithContext(ctx, i).(EgressOnlyInternetGatewayArrayOutput) 197 } 198 199 // EgressOnlyInternetGatewayMapInput is an input type that accepts EgressOnlyInternetGatewayMap and EgressOnlyInternetGatewayMapOutput values. 200 // You can construct a concrete instance of `EgressOnlyInternetGatewayMapInput` via: 201 // 202 // EgressOnlyInternetGatewayMap{ "key": EgressOnlyInternetGatewayArgs{...} } 203 type EgressOnlyInternetGatewayMapInput interface { 204 pulumi.Input 205 206 ToEgressOnlyInternetGatewayMapOutput() EgressOnlyInternetGatewayMapOutput 207 ToEgressOnlyInternetGatewayMapOutputWithContext(context.Context) EgressOnlyInternetGatewayMapOutput 208 } 209 210 type EgressOnlyInternetGatewayMap map[string]EgressOnlyInternetGatewayInput 211 212 func (EgressOnlyInternetGatewayMap) ElementType() reflect.Type { 213 return reflect.TypeOf((*map[string]*EgressOnlyInternetGateway)(nil)).Elem() 214 } 215 216 func (i EgressOnlyInternetGatewayMap) ToEgressOnlyInternetGatewayMapOutput() EgressOnlyInternetGatewayMapOutput { 217 return i.ToEgressOnlyInternetGatewayMapOutputWithContext(context.Background()) 218 } 219 220 func (i EgressOnlyInternetGatewayMap) ToEgressOnlyInternetGatewayMapOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayMapOutput { 221 return pulumi.ToOutputWithContext(ctx, i).(EgressOnlyInternetGatewayMapOutput) 222 } 223 224 type EgressOnlyInternetGatewayOutput struct{ *pulumi.OutputState } 225 226 func (EgressOnlyInternetGatewayOutput) ElementType() reflect.Type { 227 return reflect.TypeOf((**EgressOnlyInternetGateway)(nil)).Elem() 228 } 229 230 func (o EgressOnlyInternetGatewayOutput) ToEgressOnlyInternetGatewayOutput() EgressOnlyInternetGatewayOutput { 231 return o 232 } 233 234 func (o EgressOnlyInternetGatewayOutput) ToEgressOnlyInternetGatewayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayOutput { 235 return o 236 } 237 238 // 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. 239 func (o EgressOnlyInternetGatewayOutput) Tags() pulumi.StringMapOutput { 240 return o.ApplyT(func(v *EgressOnlyInternetGateway) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 241 } 242 243 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 244 // 245 // Deprecated: Please use `tags` instead. 246 func (o EgressOnlyInternetGatewayOutput) TagsAll() pulumi.StringMapOutput { 247 return o.ApplyT(func(v *EgressOnlyInternetGateway) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 248 } 249 250 // The VPC ID to create in. 251 func (o EgressOnlyInternetGatewayOutput) VpcId() pulumi.StringOutput { 252 return o.ApplyT(func(v *EgressOnlyInternetGateway) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput) 253 } 254 255 type EgressOnlyInternetGatewayArrayOutput struct{ *pulumi.OutputState } 256 257 func (EgressOnlyInternetGatewayArrayOutput) ElementType() reflect.Type { 258 return reflect.TypeOf((*[]*EgressOnlyInternetGateway)(nil)).Elem() 259 } 260 261 func (o EgressOnlyInternetGatewayArrayOutput) ToEgressOnlyInternetGatewayArrayOutput() EgressOnlyInternetGatewayArrayOutput { 262 return o 263 } 264 265 func (o EgressOnlyInternetGatewayArrayOutput) ToEgressOnlyInternetGatewayArrayOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayArrayOutput { 266 return o 267 } 268 269 func (o EgressOnlyInternetGatewayArrayOutput) Index(i pulumi.IntInput) EgressOnlyInternetGatewayOutput { 270 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EgressOnlyInternetGateway { 271 return vs[0].([]*EgressOnlyInternetGateway)[vs[1].(int)] 272 }).(EgressOnlyInternetGatewayOutput) 273 } 274 275 type EgressOnlyInternetGatewayMapOutput struct{ *pulumi.OutputState } 276 277 func (EgressOnlyInternetGatewayMapOutput) ElementType() reflect.Type { 278 return reflect.TypeOf((*map[string]*EgressOnlyInternetGateway)(nil)).Elem() 279 } 280 281 func (o EgressOnlyInternetGatewayMapOutput) ToEgressOnlyInternetGatewayMapOutput() EgressOnlyInternetGatewayMapOutput { 282 return o 283 } 284 285 func (o EgressOnlyInternetGatewayMapOutput) ToEgressOnlyInternetGatewayMapOutputWithContext(ctx context.Context) EgressOnlyInternetGatewayMapOutput { 286 return o 287 } 288 289 func (o EgressOnlyInternetGatewayMapOutput) MapIndex(k pulumi.StringInput) EgressOnlyInternetGatewayOutput { 290 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EgressOnlyInternetGateway { 291 return vs[0].(map[string]*EgressOnlyInternetGateway)[vs[1].(string)] 292 }).(EgressOnlyInternetGatewayOutput) 293 } 294 295 func init() { 296 pulumi.RegisterInputType(reflect.TypeOf((*EgressOnlyInternetGatewayInput)(nil)).Elem(), &EgressOnlyInternetGateway{}) 297 pulumi.RegisterInputType(reflect.TypeOf((*EgressOnlyInternetGatewayArrayInput)(nil)).Elem(), EgressOnlyInternetGatewayArray{}) 298 pulumi.RegisterInputType(reflect.TypeOf((*EgressOnlyInternetGatewayMapInput)(nil)).Elem(), EgressOnlyInternetGatewayMap{}) 299 pulumi.RegisterOutputType(EgressOnlyInternetGatewayOutput{}) 300 pulumi.RegisterOutputType(EgressOnlyInternetGatewayArrayOutput{}) 301 pulumi.RegisterOutputType(EgressOnlyInternetGatewayMapOutput{}) 302 }