All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.ec2.SubnetArgs Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

The newest version!
// *** 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.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class SubnetArgs extends com.pulumi.resources.ResourceArgs {

    public static final SubnetArgs Empty = new SubnetArgs();

    /**
     * Specify true to indicate
     * that network interfaces created in the specified subnet should be
     * assigned an IPv6 address. Default is `false`
     * 
     */
    @Import(name="assignIpv6AddressOnCreation")
    private @Nullable Output assignIpv6AddressOnCreation;

    /**
     * @return Specify true to indicate
     * that network interfaces created in the specified subnet should be
     * assigned an IPv6 address. Default is `false`
     * 
     */
    public Optional> assignIpv6AddressOnCreation() {
        return Optional.ofNullable(this.assignIpv6AddressOnCreation);
    }

    /**
     * AZ for the subnet.
     * 
     */
    @Import(name="availabilityZone")
    private @Nullable Output availabilityZone;

    /**
     * @return AZ for the subnet.
     * 
     */
    public Optional> availabilityZone() {
        return Optional.ofNullable(this.availabilityZone);
    }

    /**
     * AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availability_zone` instead.
     * 
     */
    @Import(name="availabilityZoneId")
    private @Nullable Output availabilityZoneId;

    /**
     * @return AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availability_zone` instead.
     * 
     */
    public Optional> availabilityZoneId() {
        return Optional.ofNullable(this.availabilityZoneId);
    }

    /**
     * The IPv4 CIDR block for the subnet.
     * 
     */
    @Import(name="cidrBlock")
    private @Nullable Output cidrBlock;

    /**
     * @return The IPv4 CIDR block for the subnet.
     * 
     */
    public Optional> cidrBlock() {
        return Optional.ofNullable(this.cidrBlock);
    }

    /**
     * The customer owned IPv4 address pool. Typically used with the `map_customer_owned_ip_on_launch` argument. The `outpost_arn` argument must be specified when configured.
     * 
     */
    @Import(name="customerOwnedIpv4Pool")
    private @Nullable Output customerOwnedIpv4Pool;

    /**
     * @return The customer owned IPv4 address pool. Typically used with the `map_customer_owned_ip_on_launch` argument. The `outpost_arn` argument must be specified when configured.
     * 
     */
    public Optional> customerOwnedIpv4Pool() {
        return Optional.ofNullable(this.customerOwnedIpv4Pool);
    }

    /**
     * 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`.
     * 
     */
    @Import(name="enableDns64")
    private @Nullable Output enableDns64;

    /**
     * @return 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`.
     * 
     */
    public Optional> enableDns64() {
        return Optional.ofNullable(this.enableDns64);
    }

    /**
     * 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).
     * 
     */
    @Import(name="enableLniAtDeviceIndex")
    private @Nullable Output enableLniAtDeviceIndex;

    /**
     * @return 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).
     * 
     */
    public Optional> enableLniAtDeviceIndex() {
        return Optional.ofNullable(this.enableLniAtDeviceIndex);
    }

    /**
     * Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`.
     * 
     */
    @Import(name="enableResourceNameDnsARecordOnLaunch")
    private @Nullable Output enableResourceNameDnsARecordOnLaunch;

    /**
     * @return Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`.
     * 
     */
    public Optional> enableResourceNameDnsARecordOnLaunch() {
        return Optional.ofNullable(this.enableResourceNameDnsARecordOnLaunch);
    }

    /**
     * Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`.
     * 
     */
    @Import(name="enableResourceNameDnsAaaaRecordOnLaunch")
    private @Nullable Output enableResourceNameDnsAaaaRecordOnLaunch;

    /**
     * @return Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`.
     * 
     */
    public Optional> enableResourceNameDnsAaaaRecordOnLaunch() {
        return Optional.ofNullable(this.enableResourceNameDnsAaaaRecordOnLaunch);
    }

    /**
     * The IPv6 network range for the subnet,
     * in CIDR notation. The subnet size must use a /64 prefix length.
     * 
     */
    @Import(name="ipv6CidrBlock")
    private @Nullable Output ipv6CidrBlock;

    /**
     * @return The IPv6 network range for the subnet,
     * in CIDR notation. The subnet size must use a /64 prefix length.
     * 
     */
    public Optional> ipv6CidrBlock() {
        return Optional.ofNullable(this.ipv6CidrBlock);
    }

    /**
     * Indicates whether to create an IPv6-only subnet. Default: `false`.
     * 
     */
    @Import(name="ipv6Native")
    private @Nullable Output ipv6Native;

    /**
     * @return Indicates whether to create an IPv6-only subnet. Default: `false`.
     * 
     */
    public Optional> ipv6Native() {
        return Optional.ofNullable(this.ipv6Native);
    }

    /**
     * Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customer_owned_ipv4_pool` and `outpost_arn` arguments must be specified when set to `true`. Default is `false`.
     * 
     */
    @Import(name="mapCustomerOwnedIpOnLaunch")
    private @Nullable Output mapCustomerOwnedIpOnLaunch;

    /**
     * @return Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customer_owned_ipv4_pool` and `outpost_arn` arguments must be specified when set to `true`. Default is `false`.
     * 
     */
    public Optional> mapCustomerOwnedIpOnLaunch() {
        return Optional.ofNullable(this.mapCustomerOwnedIpOnLaunch);
    }

    /**
     * Specify true to indicate
     * that instances launched into the subnet should be assigned
     * a public IP address. Default is `false`.
     * 
     */
    @Import(name="mapPublicIpOnLaunch")
    private @Nullable Output mapPublicIpOnLaunch;

    /**
     * @return Specify true to indicate
     * that instances launched into the subnet should be assigned
     * a public IP address. Default is `false`.
     * 
     */
    public Optional> mapPublicIpOnLaunch() {
        return Optional.ofNullable(this.mapPublicIpOnLaunch);
    }

    /**
     * The Amazon Resource Name (ARN) of the Outpost.
     * 
     */
    @Import(name="outpostArn")
    private @Nullable Output outpostArn;

    /**
     * @return The Amazon Resource Name (ARN) of the Outpost.
     * 
     */
    public Optional> outpostArn() {
        return Optional.ofNullable(this.outpostArn);
    }

    /**
     * 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`.
     * 
     */
    @Import(name="privateDnsHostnameTypeOnLaunch")
    private @Nullable Output privateDnsHostnameTypeOnLaunch;

    /**
     * @return 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`.
     * 
     */
    public Optional> privateDnsHostnameTypeOnLaunch() {
        return Optional.ofNullable(this.privateDnsHostnameTypeOnLaunch);
    }

    /**
     * A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    /**
     * The VPC ID.
     * 
     */
    @Import(name="vpcId", required=true)
    private Output vpcId;

    /**
     * @return The VPC ID.
     * 
     */
    public Output vpcId() {
        return this.vpcId;
    }

    private SubnetArgs() {}

    private SubnetArgs(SubnetArgs $) {
        this.assignIpv6AddressOnCreation = $.assignIpv6AddressOnCreation;
        this.availabilityZone = $.availabilityZone;
        this.availabilityZoneId = $.availabilityZoneId;
        this.cidrBlock = $.cidrBlock;
        this.customerOwnedIpv4Pool = $.customerOwnedIpv4Pool;
        this.enableDns64 = $.enableDns64;
        this.enableLniAtDeviceIndex = $.enableLniAtDeviceIndex;
        this.enableResourceNameDnsARecordOnLaunch = $.enableResourceNameDnsARecordOnLaunch;
        this.enableResourceNameDnsAaaaRecordOnLaunch = $.enableResourceNameDnsAaaaRecordOnLaunch;
        this.ipv6CidrBlock = $.ipv6CidrBlock;
        this.ipv6Native = $.ipv6Native;
        this.mapCustomerOwnedIpOnLaunch = $.mapCustomerOwnedIpOnLaunch;
        this.mapPublicIpOnLaunch = $.mapPublicIpOnLaunch;
        this.outpostArn = $.outpostArn;
        this.privateDnsHostnameTypeOnLaunch = $.privateDnsHostnameTypeOnLaunch;
        this.tags = $.tags;
        this.vpcId = $.vpcId;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(SubnetArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private SubnetArgs $;

        public Builder() {
            $ = new SubnetArgs();
        }

        public Builder(SubnetArgs defaults) {
            $ = new SubnetArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param assignIpv6AddressOnCreation Specify true to indicate
         * that network interfaces created in the specified subnet should be
         * assigned an IPv6 address. Default is `false`
         * 
         * @return builder
         * 
         */
        public Builder assignIpv6AddressOnCreation(@Nullable Output assignIpv6AddressOnCreation) {
            $.assignIpv6AddressOnCreation = assignIpv6AddressOnCreation;
            return this;
        }

        /**
         * @param assignIpv6AddressOnCreation Specify true to indicate
         * that network interfaces created in the specified subnet should be
         * assigned an IPv6 address. Default is `false`
         * 
         * @return builder
         * 
         */
        public Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation) {
            return assignIpv6AddressOnCreation(Output.of(assignIpv6AddressOnCreation));
        }

        /**
         * @param availabilityZone AZ for the subnet.
         * 
         * @return builder
         * 
         */
        public Builder availabilityZone(@Nullable Output availabilityZone) {
            $.availabilityZone = availabilityZone;
            return this;
        }

        /**
         * @param availabilityZone AZ for the subnet.
         * 
         * @return builder
         * 
         */
        public Builder availabilityZone(String availabilityZone) {
            return availabilityZone(Output.of(availabilityZone));
        }

        /**
         * @param availabilityZoneId AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availability_zone` instead.
         * 
         * @return builder
         * 
         */
        public Builder availabilityZoneId(@Nullable Output availabilityZoneId) {
            $.availabilityZoneId = availabilityZoneId;
            return this;
        }

        /**
         * @param availabilityZoneId AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use `availability_zone` instead.
         * 
         * @return builder
         * 
         */
        public Builder availabilityZoneId(String availabilityZoneId) {
            return availabilityZoneId(Output.of(availabilityZoneId));
        }

        /**
         * @param cidrBlock The IPv4 CIDR block for the subnet.
         * 
         * @return builder
         * 
         */
        public Builder cidrBlock(@Nullable Output cidrBlock) {
            $.cidrBlock = cidrBlock;
            return this;
        }

        /**
         * @param cidrBlock The IPv4 CIDR block for the subnet.
         * 
         * @return builder
         * 
         */
        public Builder cidrBlock(String cidrBlock) {
            return cidrBlock(Output.of(cidrBlock));
        }

        /**
         * @param customerOwnedIpv4Pool The customer owned IPv4 address pool. Typically used with the `map_customer_owned_ip_on_launch` argument. The `outpost_arn` argument must be specified when configured.
         * 
         * @return builder
         * 
         */
        public Builder customerOwnedIpv4Pool(@Nullable Output customerOwnedIpv4Pool) {
            $.customerOwnedIpv4Pool = customerOwnedIpv4Pool;
            return this;
        }

        /**
         * @param customerOwnedIpv4Pool The customer owned IPv4 address pool. Typically used with the `map_customer_owned_ip_on_launch` argument. The `outpost_arn` argument must be specified when configured.
         * 
         * @return builder
         * 
         */
        public Builder customerOwnedIpv4Pool(String customerOwnedIpv4Pool) {
            return customerOwnedIpv4Pool(Output.of(customerOwnedIpv4Pool));
        }

        /**
         * @param enableDns64 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`.
         * 
         * @return builder
         * 
         */
        public Builder enableDns64(@Nullable Output enableDns64) {
            $.enableDns64 = enableDns64;
            return this;
        }

        /**
         * @param enableDns64 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`.
         * 
         * @return builder
         * 
         */
        public Builder enableDns64(Boolean enableDns64) {
            return enableDns64(Output.of(enableDns64));
        }

        /**
         * @param enableLniAtDeviceIndex 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).
         * 
         * @return builder
         * 
         */
        public Builder enableLniAtDeviceIndex(@Nullable Output enableLniAtDeviceIndex) {
            $.enableLniAtDeviceIndex = enableLniAtDeviceIndex;
            return this;
        }

        /**
         * @param enableLniAtDeviceIndex 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).
         * 
         * @return builder
         * 
         */
        public Builder enableLniAtDeviceIndex(Integer enableLniAtDeviceIndex) {
            return enableLniAtDeviceIndex(Output.of(enableLniAtDeviceIndex));
        }

        /**
         * @param enableResourceNameDnsARecordOnLaunch Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`.
         * 
         * @return builder
         * 
         */
        public Builder enableResourceNameDnsARecordOnLaunch(@Nullable Output enableResourceNameDnsARecordOnLaunch) {
            $.enableResourceNameDnsARecordOnLaunch = enableResourceNameDnsARecordOnLaunch;
            return this;
        }

        /**
         * @param enableResourceNameDnsARecordOnLaunch Indicates whether to respond to DNS queries for instance hostnames with DNS A records. Default: `false`.
         * 
         * @return builder
         * 
         */
        public Builder enableResourceNameDnsARecordOnLaunch(Boolean enableResourceNameDnsARecordOnLaunch) {
            return enableResourceNameDnsARecordOnLaunch(Output.of(enableResourceNameDnsARecordOnLaunch));
        }

        /**
         * @param enableResourceNameDnsAaaaRecordOnLaunch Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`.
         * 
         * @return builder
         * 
         */
        public Builder enableResourceNameDnsAaaaRecordOnLaunch(@Nullable Output enableResourceNameDnsAaaaRecordOnLaunch) {
            $.enableResourceNameDnsAaaaRecordOnLaunch = enableResourceNameDnsAaaaRecordOnLaunch;
            return this;
        }

        /**
         * @param enableResourceNameDnsAaaaRecordOnLaunch Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: `false`.
         * 
         * @return builder
         * 
         */
        public Builder enableResourceNameDnsAaaaRecordOnLaunch(Boolean enableResourceNameDnsAaaaRecordOnLaunch) {
            return enableResourceNameDnsAaaaRecordOnLaunch(Output.of(enableResourceNameDnsAaaaRecordOnLaunch));
        }

        /**
         * @param ipv6CidrBlock The IPv6 network range for the subnet,
         * in CIDR notation. The subnet size must use a /64 prefix length.
         * 
         * @return builder
         * 
         */
        public Builder ipv6CidrBlock(@Nullable Output ipv6CidrBlock) {
            $.ipv6CidrBlock = ipv6CidrBlock;
            return this;
        }

        /**
         * @param ipv6CidrBlock The IPv6 network range for the subnet,
         * in CIDR notation. The subnet size must use a /64 prefix length.
         * 
         * @return builder
         * 
         */
        public Builder ipv6CidrBlock(String ipv6CidrBlock) {
            return ipv6CidrBlock(Output.of(ipv6CidrBlock));
        }

        /**
         * @param ipv6Native Indicates whether to create an IPv6-only subnet. Default: `false`.
         * 
         * @return builder
         * 
         */
        public Builder ipv6Native(@Nullable Output ipv6Native) {
            $.ipv6Native = ipv6Native;
            return this;
        }

        /**
         * @param ipv6Native Indicates whether to create an IPv6-only subnet. Default: `false`.
         * 
         * @return builder
         * 
         */
        public Builder ipv6Native(Boolean ipv6Native) {
            return ipv6Native(Output.of(ipv6Native));
        }

        /**
         * @param mapCustomerOwnedIpOnLaunch Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customer_owned_ipv4_pool` and `outpost_arn` arguments must be specified when set to `true`. Default is `false`.
         * 
         * @return builder
         * 
         */
        public Builder mapCustomerOwnedIpOnLaunch(@Nullable Output mapCustomerOwnedIpOnLaunch) {
            $.mapCustomerOwnedIpOnLaunch = mapCustomerOwnedIpOnLaunch;
            return this;
        }

        /**
         * @param mapCustomerOwnedIpOnLaunch Specify `true` to indicate that network interfaces created in the subnet should be assigned a customer owned IP address. The `customer_owned_ipv4_pool` and `outpost_arn` arguments must be specified when set to `true`. Default is `false`.
         * 
         * @return builder
         * 
         */
        public Builder mapCustomerOwnedIpOnLaunch(Boolean mapCustomerOwnedIpOnLaunch) {
            return mapCustomerOwnedIpOnLaunch(Output.of(mapCustomerOwnedIpOnLaunch));
        }

        /**
         * @param mapPublicIpOnLaunch Specify true to indicate
         * that instances launched into the subnet should be assigned
         * a public IP address. Default is `false`.
         * 
         * @return builder
         * 
         */
        public Builder mapPublicIpOnLaunch(@Nullable Output mapPublicIpOnLaunch) {
            $.mapPublicIpOnLaunch = mapPublicIpOnLaunch;
            return this;
        }

        /**
         * @param mapPublicIpOnLaunch Specify true to indicate
         * that instances launched into the subnet should be assigned
         * a public IP address. Default is `false`.
         * 
         * @return builder
         * 
         */
        public Builder mapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch) {
            return mapPublicIpOnLaunch(Output.of(mapPublicIpOnLaunch));
        }

        /**
         * @param outpostArn The Amazon Resource Name (ARN) of the Outpost.
         * 
         * @return builder
         * 
         */
        public Builder outpostArn(@Nullable Output outpostArn) {
            $.outpostArn = outpostArn;
            return this;
        }

        /**
         * @param outpostArn The Amazon Resource Name (ARN) of the Outpost.
         * 
         * @return builder
         * 
         */
        public Builder outpostArn(String outpostArn) {
            return outpostArn(Output.of(outpostArn));
        }

        /**
         * @param privateDnsHostnameTypeOnLaunch 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`.
         * 
         * @return builder
         * 
         */
        public Builder privateDnsHostnameTypeOnLaunch(@Nullable Output privateDnsHostnameTypeOnLaunch) {
            $.privateDnsHostnameTypeOnLaunch = privateDnsHostnameTypeOnLaunch;
            return this;
        }

        /**
         * @param privateDnsHostnameTypeOnLaunch 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`.
         * 
         * @return builder
         * 
         */
        public Builder privateDnsHostnameTypeOnLaunch(String privateDnsHostnameTypeOnLaunch) {
            return privateDnsHostnameTypeOnLaunch(Output.of(privateDnsHostnameTypeOnLaunch));
        }

        /**
         * @param tags A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        /**
         * @param vpcId The VPC ID.
         * 
         * @return builder
         * 
         */
        public Builder vpcId(Output vpcId) {
            $.vpcId = vpcId;
            return this;
        }

        /**
         * @param vpcId The VPC ID.
         * 
         * @return builder
         * 
         */
        public Builder vpcId(String vpcId) {
            return vpcId(Output.of(vpcId));
        }

        public SubnetArgs build() {
            if ($.vpcId == null) {
                throw new MissingRequiredPropertyException("SubnetArgs", "vpcId");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy