github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/subnet.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 // Provides an VPC subnet resource. 16 // 17 // > **NOTE:** Due to [AWS Lambda improved VPC networking changes that began deploying in September 2019](https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/), subnets associated with Lambda Functions can take up to 45 minutes to successfully delete. 18 // 19 // ## Example Usage 20 // 21 // ### Basic Usage 22 // 23 // <!--Start PulumiCodeChooser --> 24 // ```go 25 // package main 26 // 27 // import ( 28 // 29 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 30 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 31 // 32 // ) 33 // 34 // func main() { 35 // pulumi.Run(func(ctx *pulumi.Context) error { 36 // _, err := ec2.NewSubnet(ctx, "main", &ec2.SubnetArgs{ 37 // VpcId: pulumi.Any(mainAwsVpc.Id), 38 // CidrBlock: pulumi.String("10.0.1.0/24"), 39 // Tags: pulumi.StringMap{ 40 // "Name": pulumi.String("Main"), 41 // }, 42 // }) 43 // if err != nil { 44 // return err 45 // } 46 // return nil 47 // }) 48 // } 49 // 50 // ``` 51 // <!--End PulumiCodeChooser --> 52 // 53 // ### Subnets In Secondary VPC CIDR Blocks 54 // 55 // When managing subnets in one of a VPC's secondary CIDR blocks created using a `ec2.VpcIpv4CidrBlockAssociation` 56 // resource, it is recommended to reference that resource's `vpcId` attribute to ensure correct dependency ordering. 57 // 58 // <!--Start PulumiCodeChooser --> 59 // ```go 60 // package main 61 // 62 // import ( 63 // 64 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 65 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 66 // 67 // ) 68 // 69 // func main() { 70 // pulumi.Run(func(ctx *pulumi.Context) error { 71 // secondaryCidr, err := ec2.NewVpcIpv4CidrBlockAssociation(ctx, "secondary_cidr", &ec2.VpcIpv4CidrBlockAssociationArgs{ 72 // VpcId: pulumi.Any(main.Id), 73 // CidrBlock: pulumi.String("172.20.0.0/16"), 74 // }) 75 // if err != nil { 76 // return err 77 // } 78 // _, err = ec2.NewSubnet(ctx, "in_secondary_cidr", &ec2.SubnetArgs{ 79 // VpcId: secondaryCidr.VpcId, 80 // CidrBlock: pulumi.String("172.20.0.0/24"), 81 // }) 82 // if err != nil { 83 // return err 84 // } 85 // return nil 86 // }) 87 // } 88 // 89 // ``` 90 // <!--End PulumiCodeChooser --> 91 // 92 // ## Import 93 // 94 // Using `pulumi import`, import subnets using the subnet `id`. For example: 95 // 96 // ```sh 97 // $ pulumi import aws:ec2/subnet:Subnet public_subnet subnet-9d4a7b6c 98 // ``` 99 type Subnet struct { 100 pulumi.CustomResourceState 101 102 // The ARN of the subnet. 103 Arn pulumi.StringOutput `pulumi:"arn"` 104 // Specify true to indicate 105 // that network interfaces created in the specified subnet should be 106 // assigned an IPv6 address. Default is `false` 107 AssignIpv6AddressOnCreation pulumi.BoolPtrOutput `pulumi:"assignIpv6AddressOnCreation"` 108 // AZ for the subnet. 109 AvailabilityZone pulumi.StringOutput `pulumi:"availabilityZone"` 110 // AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availabilityZone` instead. 111 AvailabilityZoneId pulumi.StringOutput `pulumi:"availabilityZoneId"` 112 // The IPv4 CIDR block for the subnet. 113 CidrBlock pulumi.StringPtrOutput `pulumi:"cidrBlock"` 114 // The customer owned IPv4 address pool. Typically used with the `mapCustomerOwnedIpOnLaunch` argument. The `outpostArn` argument must be specified when configured. 115 CustomerOwnedIpv4Pool pulumi.StringPtrOutput `pulumi:"customerOwnedIpv4Pool"` 116 // Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: `false`. 117 EnableDns64 pulumi.BoolPtrOutput `pulumi:"enableDns64"` 118 // Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). 119 EnableLniAtDeviceIndex pulumi.IntPtrOutput `pulumi:"enableLniAtDeviceIndex"` 120 // Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`. 121 EnableResourceNameDnsARecordOnLaunch pulumi.BoolPtrOutput `pulumi:"enableResourceNameDnsARecordOnLaunch"` 122 // Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`. 123 EnableResourceNameDnsAaaaRecordOnLaunch pulumi.BoolPtrOutput `pulumi:"enableResourceNameDnsAaaaRecordOnLaunch"` 124 // The IPv6 network range for the subnet, 125 // in CIDR notation. The subnet size must use a /64 prefix length. 126 Ipv6CidrBlock pulumi.StringPtrOutput `pulumi:"ipv6CidrBlock"` 127 // The association ID for the IPv6 CIDR block. 128 Ipv6CidrBlockAssociationId pulumi.StringOutput `pulumi:"ipv6CidrBlockAssociationId"` 129 // Indicates whether to create an IPv6-only subnet. Default: `false`. 130 Ipv6Native pulumi.BoolPtrOutput `pulumi:"ipv6Native"` 131 // Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customerOwnedIpv4Pool` and `outpostArn` arguments must be specified when set to `true`. Default is `false`. 132 MapCustomerOwnedIpOnLaunch pulumi.BoolPtrOutput `pulumi:"mapCustomerOwnedIpOnLaunch"` 133 // Specify true to indicate 134 // that instances launched into the subnet should be assigned 135 // a public IP address. Default is `false`. 136 MapPublicIpOnLaunch pulumi.BoolPtrOutput `pulumi:"mapPublicIpOnLaunch"` 137 // The Amazon Resource Name (ARN) of the Outpost. 138 OutpostArn pulumi.StringPtrOutput `pulumi:"outpostArn"` 139 // The ID of the AWS account that owns the subnet. 140 OwnerId pulumi.StringOutput `pulumi:"ownerId"` 141 // The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name`. 142 PrivateDnsHostnameTypeOnLaunch pulumi.StringOutput `pulumi:"privateDnsHostnameTypeOnLaunch"` 143 // 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. 144 Tags pulumi.StringMapOutput `pulumi:"tags"` 145 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 146 // 147 // Deprecated: Please use `tags` instead. 148 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 149 // The VPC ID. 150 VpcId pulumi.StringOutput `pulumi:"vpcId"` 151 } 152 153 // NewSubnet registers a new resource with the given unique name, arguments, and options. 154 func NewSubnet(ctx *pulumi.Context, 155 name string, args *SubnetArgs, opts ...pulumi.ResourceOption) (*Subnet, error) { 156 if args == nil { 157 return nil, errors.New("missing one or more required arguments") 158 } 159 160 if args.VpcId == nil { 161 return nil, errors.New("invalid value for required argument 'VpcId'") 162 } 163 opts = internal.PkgResourceDefaultOpts(opts) 164 var resource Subnet 165 err := ctx.RegisterResource("aws:ec2/subnet:Subnet", name, args, &resource, opts...) 166 if err != nil { 167 return nil, err 168 } 169 return &resource, nil 170 } 171 172 // GetSubnet gets an existing Subnet resource's state with the given name, ID, and optional 173 // state properties that are used to uniquely qualify the lookup (nil if not required). 174 func GetSubnet(ctx *pulumi.Context, 175 name string, id pulumi.IDInput, state *SubnetState, opts ...pulumi.ResourceOption) (*Subnet, error) { 176 var resource Subnet 177 err := ctx.ReadResource("aws:ec2/subnet:Subnet", name, id, state, &resource, opts...) 178 if err != nil { 179 return nil, err 180 } 181 return &resource, nil 182 } 183 184 // Input properties used for looking up and filtering Subnet resources. 185 type subnetState struct { 186 // The ARN of the subnet. 187 Arn *string `pulumi:"arn"` 188 // Specify true to indicate 189 // that network interfaces created in the specified subnet should be 190 // assigned an IPv6 address. Default is `false` 191 AssignIpv6AddressOnCreation *bool `pulumi:"assignIpv6AddressOnCreation"` 192 // AZ for the subnet. 193 AvailabilityZone *string `pulumi:"availabilityZone"` 194 // AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availabilityZone` instead. 195 AvailabilityZoneId *string `pulumi:"availabilityZoneId"` 196 // The IPv4 CIDR block for the subnet. 197 CidrBlock *string `pulumi:"cidrBlock"` 198 // The customer owned IPv4 address pool. Typically used with the `mapCustomerOwnedIpOnLaunch` argument. The `outpostArn` argument must be specified when configured. 199 CustomerOwnedIpv4Pool *string `pulumi:"customerOwnedIpv4Pool"` 200 // Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: `false`. 201 EnableDns64 *bool `pulumi:"enableDns64"` 202 // Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). 203 EnableLniAtDeviceIndex *int `pulumi:"enableLniAtDeviceIndex"` 204 // Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`. 205 EnableResourceNameDnsARecordOnLaunch *bool `pulumi:"enableResourceNameDnsARecordOnLaunch"` 206 // Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`. 207 EnableResourceNameDnsAaaaRecordOnLaunch *bool `pulumi:"enableResourceNameDnsAaaaRecordOnLaunch"` 208 // The IPv6 network range for the subnet, 209 // in CIDR notation. The subnet size must use a /64 prefix length. 210 Ipv6CidrBlock *string `pulumi:"ipv6CidrBlock"` 211 // The association ID for the IPv6 CIDR block. 212 Ipv6CidrBlockAssociationId *string `pulumi:"ipv6CidrBlockAssociationId"` 213 // Indicates whether to create an IPv6-only subnet. Default: `false`. 214 Ipv6Native *bool `pulumi:"ipv6Native"` 215 // Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customerOwnedIpv4Pool` and `outpostArn` arguments must be specified when set to `true`. Default is `false`. 216 MapCustomerOwnedIpOnLaunch *bool `pulumi:"mapCustomerOwnedIpOnLaunch"` 217 // Specify true to indicate 218 // that instances launched into the subnet should be assigned 219 // a public IP address. Default is `false`. 220 MapPublicIpOnLaunch *bool `pulumi:"mapPublicIpOnLaunch"` 221 // The Amazon Resource Name (ARN) of the Outpost. 222 OutpostArn *string `pulumi:"outpostArn"` 223 // The ID of the AWS account that owns the subnet. 224 OwnerId *string `pulumi:"ownerId"` 225 // The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name`. 226 PrivateDnsHostnameTypeOnLaunch *string `pulumi:"privateDnsHostnameTypeOnLaunch"` 227 // 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. 228 Tags map[string]string `pulumi:"tags"` 229 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 230 // 231 // Deprecated: Please use `tags` instead. 232 TagsAll map[string]string `pulumi:"tagsAll"` 233 // The VPC ID. 234 VpcId *string `pulumi:"vpcId"` 235 } 236 237 type SubnetState struct { 238 // The ARN of the subnet. 239 Arn pulumi.StringPtrInput 240 // Specify true to indicate 241 // that network interfaces created in the specified subnet should be 242 // assigned an IPv6 address. Default is `false` 243 AssignIpv6AddressOnCreation pulumi.BoolPtrInput 244 // AZ for the subnet. 245 AvailabilityZone pulumi.StringPtrInput 246 // AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availabilityZone` instead. 247 AvailabilityZoneId pulumi.StringPtrInput 248 // The IPv4 CIDR block for the subnet. 249 CidrBlock pulumi.StringPtrInput 250 // The customer owned IPv4 address pool. Typically used with the `mapCustomerOwnedIpOnLaunch` argument. The `outpostArn` argument must be specified when configured. 251 CustomerOwnedIpv4Pool pulumi.StringPtrInput 252 // Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: `false`. 253 EnableDns64 pulumi.BoolPtrInput 254 // Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). 255 EnableLniAtDeviceIndex pulumi.IntPtrInput 256 // Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`. 257 EnableResourceNameDnsARecordOnLaunch pulumi.BoolPtrInput 258 // Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`. 259 EnableResourceNameDnsAaaaRecordOnLaunch pulumi.BoolPtrInput 260 // The IPv6 network range for the subnet, 261 // in CIDR notation. The subnet size must use a /64 prefix length. 262 Ipv6CidrBlock pulumi.StringPtrInput 263 // The association ID for the IPv6 CIDR block. 264 Ipv6CidrBlockAssociationId pulumi.StringPtrInput 265 // Indicates whether to create an IPv6-only subnet. Default: `false`. 266 Ipv6Native pulumi.BoolPtrInput 267 // Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customerOwnedIpv4Pool` and `outpostArn` arguments must be specified when set to `true`. Default is `false`. 268 MapCustomerOwnedIpOnLaunch pulumi.BoolPtrInput 269 // Specify true to indicate 270 // that instances launched into the subnet should be assigned 271 // a public IP address. Default is `false`. 272 MapPublicIpOnLaunch pulumi.BoolPtrInput 273 // The Amazon Resource Name (ARN) of the Outpost. 274 OutpostArn pulumi.StringPtrInput 275 // The ID of the AWS account that owns the subnet. 276 OwnerId pulumi.StringPtrInput 277 // The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name`. 278 PrivateDnsHostnameTypeOnLaunch pulumi.StringPtrInput 279 // 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. 280 Tags pulumi.StringMapInput 281 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 282 // 283 // Deprecated: Please use `tags` instead. 284 TagsAll pulumi.StringMapInput 285 // The VPC ID. 286 VpcId pulumi.StringPtrInput 287 } 288 289 func (SubnetState) ElementType() reflect.Type { 290 return reflect.TypeOf((*subnetState)(nil)).Elem() 291 } 292 293 type subnetArgs struct { 294 // Specify true to indicate 295 // that network interfaces created in the specified subnet should be 296 // assigned an IPv6 address. Default is `false` 297 AssignIpv6AddressOnCreation *bool `pulumi:"assignIpv6AddressOnCreation"` 298 // AZ for the subnet. 299 AvailabilityZone *string `pulumi:"availabilityZone"` 300 // AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availabilityZone` instead. 301 AvailabilityZoneId *string `pulumi:"availabilityZoneId"` 302 // The IPv4 CIDR block for the subnet. 303 CidrBlock *string `pulumi:"cidrBlock"` 304 // The customer owned IPv4 address pool. Typically used with the `mapCustomerOwnedIpOnLaunch` argument. The `outpostArn` argument must be specified when configured. 305 CustomerOwnedIpv4Pool *string `pulumi:"customerOwnedIpv4Pool"` 306 // Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: `false`. 307 EnableDns64 *bool `pulumi:"enableDns64"` 308 // Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). 309 EnableLniAtDeviceIndex *int `pulumi:"enableLniAtDeviceIndex"` 310 // Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`. 311 EnableResourceNameDnsARecordOnLaunch *bool `pulumi:"enableResourceNameDnsARecordOnLaunch"` 312 // Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`. 313 EnableResourceNameDnsAaaaRecordOnLaunch *bool `pulumi:"enableResourceNameDnsAaaaRecordOnLaunch"` 314 // The IPv6 network range for the subnet, 315 // in CIDR notation. The subnet size must use a /64 prefix length. 316 Ipv6CidrBlock *string `pulumi:"ipv6CidrBlock"` 317 // Indicates whether to create an IPv6-only subnet. Default: `false`. 318 Ipv6Native *bool `pulumi:"ipv6Native"` 319 // Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customerOwnedIpv4Pool` and `outpostArn` arguments must be specified when set to `true`. Default is `false`. 320 MapCustomerOwnedIpOnLaunch *bool `pulumi:"mapCustomerOwnedIpOnLaunch"` 321 // Specify true to indicate 322 // that instances launched into the subnet should be assigned 323 // a public IP address. Default is `false`. 324 MapPublicIpOnLaunch *bool `pulumi:"mapPublicIpOnLaunch"` 325 // The Amazon Resource Name (ARN) of the Outpost. 326 OutpostArn *string `pulumi:"outpostArn"` 327 // The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name`. 328 PrivateDnsHostnameTypeOnLaunch *string `pulumi:"privateDnsHostnameTypeOnLaunch"` 329 // 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. 330 Tags map[string]string `pulumi:"tags"` 331 // The VPC ID. 332 VpcId string `pulumi:"vpcId"` 333 } 334 335 // The set of arguments for constructing a Subnet resource. 336 type SubnetArgs struct { 337 // Specify true to indicate 338 // that network interfaces created in the specified subnet should be 339 // assigned an IPv6 address. Default is `false` 340 AssignIpv6AddressOnCreation pulumi.BoolPtrInput 341 // AZ for the subnet. 342 AvailabilityZone pulumi.StringPtrInput 343 // AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availabilityZone` instead. 344 AvailabilityZoneId pulumi.StringPtrInput 345 // The IPv4 CIDR block for the subnet. 346 CidrBlock pulumi.StringPtrInput 347 // The customer owned IPv4 address pool. Typically used with the `mapCustomerOwnedIpOnLaunch` argument. The `outpostArn` argument must be specified when configured. 348 CustomerOwnedIpv4Pool pulumi.StringPtrInput 349 // Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: `false`. 350 EnableDns64 pulumi.BoolPtrInput 351 // Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). 352 EnableLniAtDeviceIndex pulumi.IntPtrInput 353 // Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`. 354 EnableResourceNameDnsARecordOnLaunch pulumi.BoolPtrInput 355 // Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`. 356 EnableResourceNameDnsAaaaRecordOnLaunch pulumi.BoolPtrInput 357 // The IPv6 network range for the subnet, 358 // in CIDR notation. The subnet size must use a /64 prefix length. 359 Ipv6CidrBlock pulumi.StringPtrInput 360 // Indicates whether to create an IPv6-only subnet. Default: `false`. 361 Ipv6Native pulumi.BoolPtrInput 362 // Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customerOwnedIpv4Pool` and `outpostArn` arguments must be specified when set to `true`. Default is `false`. 363 MapCustomerOwnedIpOnLaunch pulumi.BoolPtrInput 364 // Specify true to indicate 365 // that instances launched into the subnet should be assigned 366 // a public IP address. Default is `false`. 367 MapPublicIpOnLaunch pulumi.BoolPtrInput 368 // The Amazon Resource Name (ARN) of the Outpost. 369 OutpostArn pulumi.StringPtrInput 370 // The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name`. 371 PrivateDnsHostnameTypeOnLaunch pulumi.StringPtrInput 372 // 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. 373 Tags pulumi.StringMapInput 374 // The VPC ID. 375 VpcId pulumi.StringInput 376 } 377 378 func (SubnetArgs) ElementType() reflect.Type { 379 return reflect.TypeOf((*subnetArgs)(nil)).Elem() 380 } 381 382 type SubnetInput interface { 383 pulumi.Input 384 385 ToSubnetOutput() SubnetOutput 386 ToSubnetOutputWithContext(ctx context.Context) SubnetOutput 387 } 388 389 func (*Subnet) ElementType() reflect.Type { 390 return reflect.TypeOf((**Subnet)(nil)).Elem() 391 } 392 393 func (i *Subnet) ToSubnetOutput() SubnetOutput { 394 return i.ToSubnetOutputWithContext(context.Background()) 395 } 396 397 func (i *Subnet) ToSubnetOutputWithContext(ctx context.Context) SubnetOutput { 398 return pulumi.ToOutputWithContext(ctx, i).(SubnetOutput) 399 } 400 401 // SubnetArrayInput is an input type that accepts SubnetArray and SubnetArrayOutput values. 402 // You can construct a concrete instance of `SubnetArrayInput` via: 403 // 404 // SubnetArray{ SubnetArgs{...} } 405 type SubnetArrayInput interface { 406 pulumi.Input 407 408 ToSubnetArrayOutput() SubnetArrayOutput 409 ToSubnetArrayOutputWithContext(context.Context) SubnetArrayOutput 410 } 411 412 type SubnetArray []SubnetInput 413 414 func (SubnetArray) ElementType() reflect.Type { 415 return reflect.TypeOf((*[]*Subnet)(nil)).Elem() 416 } 417 418 func (i SubnetArray) ToSubnetArrayOutput() SubnetArrayOutput { 419 return i.ToSubnetArrayOutputWithContext(context.Background()) 420 } 421 422 func (i SubnetArray) ToSubnetArrayOutputWithContext(ctx context.Context) SubnetArrayOutput { 423 return pulumi.ToOutputWithContext(ctx, i).(SubnetArrayOutput) 424 } 425 426 // SubnetMapInput is an input type that accepts SubnetMap and SubnetMapOutput values. 427 // You can construct a concrete instance of `SubnetMapInput` via: 428 // 429 // SubnetMap{ "key": SubnetArgs{...} } 430 type SubnetMapInput interface { 431 pulumi.Input 432 433 ToSubnetMapOutput() SubnetMapOutput 434 ToSubnetMapOutputWithContext(context.Context) SubnetMapOutput 435 } 436 437 type SubnetMap map[string]SubnetInput 438 439 func (SubnetMap) ElementType() reflect.Type { 440 return reflect.TypeOf((*map[string]*Subnet)(nil)).Elem() 441 } 442 443 func (i SubnetMap) ToSubnetMapOutput() SubnetMapOutput { 444 return i.ToSubnetMapOutputWithContext(context.Background()) 445 } 446 447 func (i SubnetMap) ToSubnetMapOutputWithContext(ctx context.Context) SubnetMapOutput { 448 return pulumi.ToOutputWithContext(ctx, i).(SubnetMapOutput) 449 } 450 451 type SubnetOutput struct{ *pulumi.OutputState } 452 453 func (SubnetOutput) ElementType() reflect.Type { 454 return reflect.TypeOf((**Subnet)(nil)).Elem() 455 } 456 457 func (o SubnetOutput) ToSubnetOutput() SubnetOutput { 458 return o 459 } 460 461 func (o SubnetOutput) ToSubnetOutputWithContext(ctx context.Context) SubnetOutput { 462 return o 463 } 464 465 // The ARN of the subnet. 466 func (o SubnetOutput) Arn() pulumi.StringOutput { 467 return o.ApplyT(func(v *Subnet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 468 } 469 470 // Specify true to indicate 471 // that network interfaces created in the specified subnet should be 472 // assigned an IPv6 address. Default is `false` 473 func (o SubnetOutput) AssignIpv6AddressOnCreation() pulumi.BoolPtrOutput { 474 return o.ApplyT(func(v *Subnet) pulumi.BoolPtrOutput { return v.AssignIpv6AddressOnCreation }).(pulumi.BoolPtrOutput) 475 } 476 477 // AZ for the subnet. 478 func (o SubnetOutput) AvailabilityZone() pulumi.StringOutput { 479 return o.ApplyT(func(v *Subnet) pulumi.StringOutput { return v.AvailabilityZone }).(pulumi.StringOutput) 480 } 481 482 // AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availabilityZone` instead. 483 func (o SubnetOutput) AvailabilityZoneId() pulumi.StringOutput { 484 return o.ApplyT(func(v *Subnet) pulumi.StringOutput { return v.AvailabilityZoneId }).(pulumi.StringOutput) 485 } 486 487 // The IPv4 CIDR block for the subnet. 488 func (o SubnetOutput) CidrBlock() pulumi.StringPtrOutput { 489 return o.ApplyT(func(v *Subnet) pulumi.StringPtrOutput { return v.CidrBlock }).(pulumi.StringPtrOutput) 490 } 491 492 // The customer owned IPv4 address pool. Typically used with the `mapCustomerOwnedIpOnLaunch` argument. The `outpostArn` argument must be specified when configured. 493 func (o SubnetOutput) CustomerOwnedIpv4Pool() pulumi.StringPtrOutput { 494 return o.ApplyT(func(v *Subnet) pulumi.StringPtrOutput { return v.CustomerOwnedIpv4Pool }).(pulumi.StringPtrOutput) 495 } 496 497 // Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: `false`. 498 func (o SubnetOutput) EnableDns64() pulumi.BoolPtrOutput { 499 return o.ApplyT(func(v *Subnet) pulumi.BoolPtrOutput { return v.EnableDns64 }).(pulumi.BoolPtrOutput) 500 } 501 502 // Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0). 503 func (o SubnetOutput) EnableLniAtDeviceIndex() pulumi.IntPtrOutput { 504 return o.ApplyT(func(v *Subnet) pulumi.IntPtrOutput { return v.EnableLniAtDeviceIndex }).(pulumi.IntPtrOutput) 505 } 506 507 // Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`. 508 func (o SubnetOutput) EnableResourceNameDnsARecordOnLaunch() pulumi.BoolPtrOutput { 509 return o.ApplyT(func(v *Subnet) pulumi.BoolPtrOutput { return v.EnableResourceNameDnsARecordOnLaunch }).(pulumi.BoolPtrOutput) 510 } 511 512 // Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`. 513 func (o SubnetOutput) EnableResourceNameDnsAaaaRecordOnLaunch() pulumi.BoolPtrOutput { 514 return o.ApplyT(func(v *Subnet) pulumi.BoolPtrOutput { return v.EnableResourceNameDnsAaaaRecordOnLaunch }).(pulumi.BoolPtrOutput) 515 } 516 517 // The IPv6 network range for the subnet, 518 // in CIDR notation. The subnet size must use a /64 prefix length. 519 func (o SubnetOutput) Ipv6CidrBlock() pulumi.StringPtrOutput { 520 return o.ApplyT(func(v *Subnet) pulumi.StringPtrOutput { return v.Ipv6CidrBlock }).(pulumi.StringPtrOutput) 521 } 522 523 // The association ID for the IPv6 CIDR block. 524 func (o SubnetOutput) Ipv6CidrBlockAssociationId() pulumi.StringOutput { 525 return o.ApplyT(func(v *Subnet) pulumi.StringOutput { return v.Ipv6CidrBlockAssociationId }).(pulumi.StringOutput) 526 } 527 528 // Indicates whether to create an IPv6-only subnet. Default: `false`. 529 func (o SubnetOutput) Ipv6Native() pulumi.BoolPtrOutput { 530 return o.ApplyT(func(v *Subnet) pulumi.BoolPtrOutput { return v.Ipv6Native }).(pulumi.BoolPtrOutput) 531 } 532 533 // Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customerOwnedIpv4Pool` and `outpostArn` arguments must be specified when set to `true`. Default is `false`. 534 func (o SubnetOutput) MapCustomerOwnedIpOnLaunch() pulumi.BoolPtrOutput { 535 return o.ApplyT(func(v *Subnet) pulumi.BoolPtrOutput { return v.MapCustomerOwnedIpOnLaunch }).(pulumi.BoolPtrOutput) 536 } 537 538 // Specify true to indicate 539 // that instances launched into the subnet should be assigned 540 // a public IP address. Default is `false`. 541 func (o SubnetOutput) MapPublicIpOnLaunch() pulumi.BoolPtrOutput { 542 return o.ApplyT(func(v *Subnet) pulumi.BoolPtrOutput { return v.MapPublicIpOnLaunch }).(pulumi.BoolPtrOutput) 543 } 544 545 // The Amazon Resource Name (ARN) of the Outpost. 546 func (o SubnetOutput) OutpostArn() pulumi.StringPtrOutput { 547 return o.ApplyT(func(v *Subnet) pulumi.StringPtrOutput { return v.OutpostArn }).(pulumi.StringPtrOutput) 548 } 549 550 // The ID of the AWS account that owns the subnet. 551 func (o SubnetOutput) OwnerId() pulumi.StringOutput { 552 return o.ApplyT(func(v *Subnet) pulumi.StringOutput { return v.OwnerId }).(pulumi.StringOutput) 553 } 554 555 // The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name`, `resource-name`. 556 func (o SubnetOutput) PrivateDnsHostnameTypeOnLaunch() pulumi.StringOutput { 557 return o.ApplyT(func(v *Subnet) pulumi.StringOutput { return v.PrivateDnsHostnameTypeOnLaunch }).(pulumi.StringOutput) 558 } 559 560 // 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. 561 func (o SubnetOutput) Tags() pulumi.StringMapOutput { 562 return o.ApplyT(func(v *Subnet) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 563 } 564 565 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 566 // 567 // Deprecated: Please use `tags` instead. 568 func (o SubnetOutput) TagsAll() pulumi.StringMapOutput { 569 return o.ApplyT(func(v *Subnet) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 570 } 571 572 // The VPC ID. 573 func (o SubnetOutput) VpcId() pulumi.StringOutput { 574 return o.ApplyT(func(v *Subnet) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput) 575 } 576 577 type SubnetArrayOutput struct{ *pulumi.OutputState } 578 579 func (SubnetArrayOutput) ElementType() reflect.Type { 580 return reflect.TypeOf((*[]*Subnet)(nil)).Elem() 581 } 582 583 func (o SubnetArrayOutput) ToSubnetArrayOutput() SubnetArrayOutput { 584 return o 585 } 586 587 func (o SubnetArrayOutput) ToSubnetArrayOutputWithContext(ctx context.Context) SubnetArrayOutput { 588 return o 589 } 590 591 func (o SubnetArrayOutput) Index(i pulumi.IntInput) SubnetOutput { 592 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Subnet { 593 return vs[0].([]*Subnet)[vs[1].(int)] 594 }).(SubnetOutput) 595 } 596 597 type SubnetMapOutput struct{ *pulumi.OutputState } 598 599 func (SubnetMapOutput) ElementType() reflect.Type { 600 return reflect.TypeOf((*map[string]*Subnet)(nil)).Elem() 601 } 602 603 func (o SubnetMapOutput) ToSubnetMapOutput() SubnetMapOutput { 604 return o 605 } 606 607 func (o SubnetMapOutput) ToSubnetMapOutputWithContext(ctx context.Context) SubnetMapOutput { 608 return o 609 } 610 611 func (o SubnetMapOutput) MapIndex(k pulumi.StringInput) SubnetOutput { 612 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Subnet { 613 return vs[0].(map[string]*Subnet)[vs[1].(string)] 614 }).(SubnetOutput) 615 } 616 617 func init() { 618 pulumi.RegisterInputType(reflect.TypeOf((*SubnetInput)(nil)).Elem(), &Subnet{}) 619 pulumi.RegisterInputType(reflect.TypeOf((*SubnetArrayInput)(nil)).Elem(), SubnetArray{}) 620 pulumi.RegisterInputType(reflect.TypeOf((*SubnetMapInput)(nil)).Elem(), SubnetMap{}) 621 pulumi.RegisterOutputType(SubnetOutput{}) 622 pulumi.RegisterOutputType(SubnetArrayOutput{}) 623 pulumi.RegisterOutputType(SubnetMapOutput{}) 624 }