
com.pulumi.aws.ec2.DefaultSubnet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.ec2;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.ec2.DefaultSubnetArgs;
import com.pulumi.aws.ec2.inputs.DefaultSubnetState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Provides a resource to manage a [default subnet](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html#default-vpc-basics) in the current region.
*
* **This is an advanced resource** and has special caveats to be aware of when using it. Please read this document in its entirety before using this resource.
*
* The `aws.ec2.DefaultSubnet` resource behaves differently from normal resources in that if a default subnet exists in the specified Availability Zone, this provider does not _create_ this resource, but instead "adopts" it into management.
* If no default subnet exists, this provider creates a new default subnet.
* By default, `pulumi destroy` does not delete the default subnet but does remove the resource from the state.
* Set the `force_destroy` argument to `true` to delete the default subnet.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.ec2.DefaultSubnet;
* import com.pulumi.aws.ec2.DefaultSubnetArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var defaultAz1 = new DefaultSubnet("defaultAz1", DefaultSubnetArgs.builder()
* .availabilityZone("us-west-2a")
* .tags(Map.of("Name", "Default subnet for us-west-2a"))
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Using `pulumi import`, import subnets using the subnet `id`. For example:
*
* ```sh
* $ pulumi import aws:ec2/defaultSubnet:DefaultSubnet public_subnet subnet-9d4a7b6c
* ```
*
*/
@ResourceType(type="aws:ec2/defaultSubnet:DefaultSubnet")
public class DefaultSubnet extends com.pulumi.resources.CustomResource {
@Export(name="arn", refs={String.class}, tree="[0]")
private Output arn;
public Output arn() {
return this.arn;
}
@Export(name="assignIpv6AddressOnCreation", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> assignIpv6AddressOnCreation;
public Output> assignIpv6AddressOnCreation() {
return Codegen.optional(this.assignIpv6AddressOnCreation);
}
/**
* is required
* * The `availability_zone_id`, `cidr_block` and `vpc_id` arguments become computed attributes
* * The default value for `map_public_ip_on_launch` is `true`
*
* This resource supports the following additional arguments:
*
*/
@Export(name="availabilityZone", refs={String.class}, tree="[0]")
private Output availabilityZone;
/**
* @return is required
* * The `availability_zone_id`, `cidr_block` and `vpc_id` arguments become computed attributes
* * The default value for `map_public_ip_on_launch` is `true`
*
* This resource supports the following additional arguments:
*
*/
public Output availabilityZone() {
return this.availabilityZone;
}
/**
* The AZ ID of the subnet
*
*/
@Export(name="availabilityZoneId", refs={String.class}, tree="[0]")
private Output availabilityZoneId;
/**
* @return The AZ ID of the subnet
*
*/
public Output availabilityZoneId() {
return this.availabilityZoneId;
}
/**
* The IPv4 CIDR block assigned to the subnet
*
*/
@Export(name="cidrBlock", refs={String.class}, tree="[0]")
private Output cidrBlock;
/**
* @return The IPv4 CIDR block assigned to the subnet
*
*/
public Output cidrBlock() {
return this.cidrBlock;
}
@Export(name="customerOwnedIpv4Pool", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> customerOwnedIpv4Pool;
public Output> customerOwnedIpv4Pool() {
return Codegen.optional(this.customerOwnedIpv4Pool);
}
@Export(name="enableDns64", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enableDns64;
public Output> enableDns64() {
return Codegen.optional(this.enableDns64);
}
@Export(name="enableLniAtDeviceIndex", refs={Integer.class}, tree="[0]")
private Output enableLniAtDeviceIndex;
public Output enableLniAtDeviceIndex() {
return this.enableLniAtDeviceIndex;
}
@Export(name="enableResourceNameDnsARecordOnLaunch", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enableResourceNameDnsARecordOnLaunch;
public Output> enableResourceNameDnsARecordOnLaunch() {
return Codegen.optional(this.enableResourceNameDnsARecordOnLaunch);
}
@Export(name="enableResourceNameDnsAaaaRecordOnLaunch", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enableResourceNameDnsAaaaRecordOnLaunch;
public Output> enableResourceNameDnsAaaaRecordOnLaunch() {
return Codegen.optional(this.enableResourceNameDnsAaaaRecordOnLaunch);
}
@Export(name="existingDefaultSubnet", refs={Boolean.class}, tree="[0]")
private Output existingDefaultSubnet;
public Output existingDefaultSubnet() {
return this.existingDefaultSubnet;
}
/**
* Whether destroying the resource deletes the default subnet. Default: `false`
*
*/
@Export(name="forceDestroy", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> forceDestroy;
/**
* @return Whether destroying the resource deletes the default subnet. Default: `false`
*
*/
public Output> forceDestroy() {
return Codegen.optional(this.forceDestroy);
}
@Export(name="ipv6CidrBlock", refs={String.class}, tree="[0]")
private Output ipv6CidrBlock;
public Output ipv6CidrBlock() {
return this.ipv6CidrBlock;
}
@Export(name="ipv6CidrBlockAssociationId", refs={String.class}, tree="[0]")
private Output ipv6CidrBlockAssociationId;
public Output ipv6CidrBlockAssociationId() {
return this.ipv6CidrBlockAssociationId;
}
@Export(name="ipv6Native", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> ipv6Native;
public Output> ipv6Native() {
return Codegen.optional(this.ipv6Native);
}
@Export(name="mapCustomerOwnedIpOnLaunch", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> mapCustomerOwnedIpOnLaunch;
public Output> mapCustomerOwnedIpOnLaunch() {
return Codegen.optional(this.mapCustomerOwnedIpOnLaunch);
}
@Export(name="mapPublicIpOnLaunch", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> mapPublicIpOnLaunch;
public Output> mapPublicIpOnLaunch() {
return Codegen.optional(this.mapPublicIpOnLaunch);
}
@Export(name="outpostArn", refs={String.class}, tree="[0]")
private Output outpostArn;
public Output outpostArn() {
return this.outpostArn;
}
@Export(name="ownerId", refs={String.class}, tree="[0]")
private Output ownerId;
public Output ownerId() {
return this.ownerId;
}
@Export(name="privateDnsHostnameTypeOnLaunch", refs={String.class}, tree="[0]")
private Output privateDnsHostnameTypeOnLaunch;
public Output privateDnsHostnameTypeOnLaunch() {
return this.privateDnsHostnameTypeOnLaunch;
}
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* @deprecated
* Please use `tags` instead.
*
*/
@Deprecated /* Please use `tags` instead. */
@Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]")
private Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy