Package com.pulumi.alicloud.pvtz
Class ZoneAttachment
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.alicloud.pvtz.ZoneAttachment
-
public class ZoneAttachment extends com.pulumi.resources.CustomResource
## Example Usage Using `vpc_ids` to attach being in same region several vpc instances to a private zone ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.pvtz.Zone; import com.pulumi.alicloud.pvtz.ZoneArgs; import com.pulumi.alicloud.vpc.Network; import com.pulumi.alicloud.vpc.NetworkArgs; import com.pulumi.alicloud.pvtz.ZoneAttachment; import com.pulumi.alicloud.pvtz.ZoneAttachmentArgs; 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 zone = new Zone("zone", ZoneArgs.builder() .zoneName("foo.example.com") .build()); var first = new Network("first", NetworkArgs.builder() .vpcName("the-first-vpc") .cidrBlock("172.16.0.0/12") .build()); var second = new Network("second", NetworkArgs.builder() .vpcName("the-second-vpc") .cidrBlock("172.16.0.0/16") .build()); var zone_attachment = new ZoneAttachment("zone-attachment", ZoneAttachmentArgs.builder() .zoneId(zone.id()) .vpcIds( first.id(), second.id()) .build()); } } ``` Using `vpcs` to attach being in same region several vpc instances to a private zone ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.pvtz.Zone; import com.pulumi.alicloud.pvtz.ZoneArgs; import com.pulumi.alicloud.vpc.Network; import com.pulumi.alicloud.vpc.NetworkArgs; import com.pulumi.alicloud.pvtz.ZoneAttachment; import com.pulumi.alicloud.pvtz.ZoneAttachmentArgs; import com.pulumi.alicloud.pvtz.inputs.ZoneAttachmentVpcArgs; 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 zone = new Zone("zone", ZoneArgs.builder() .zoneName("foo.example.com") .build()); var first = new Network("first", NetworkArgs.builder() .vpcName("the-first-vpc") .cidrBlock("172.16.0.0/12") .build()); var second = new Network("second", NetworkArgs.builder() .vpcName("the-second-vpc") .cidrBlock("172.16.0.0/16") .build()); var zone_attachment = new ZoneAttachment("zone-attachment", ZoneAttachmentArgs.builder() .zoneId(zone.id()) .vpcs( ZoneAttachmentVpcArgs.builder() .vpcId(first.id()) .build(), ZoneAttachmentVpcArgs.builder() .vpcId(second.id()) .build()) .build()); } } ``` Using `vpcs` to attach being in different regions several vpc instances to a private zone ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.alicloud.pvtz.Zone; import com.pulumi.alicloud.pvtz.ZoneArgs; import com.pulumi.alicloud.vpc.Network; import com.pulumi.alicloud.vpc.NetworkArgs; import com.pulumi.alicloud.Provider; import com.pulumi.alicloud.ProviderArgs; import com.pulumi.alicloud.pvtz.ZoneAttachment; import com.pulumi.alicloud.pvtz.ZoneAttachmentArgs; import com.pulumi.alicloud.pvtz.inputs.ZoneAttachmentVpcArgs; import com.pulumi.resources.CustomResourceOptions; 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 zone = new Zone("zone", ZoneArgs.builder() .zoneName("foo.example.com") .build()); var first = new Network("first", NetworkArgs.builder() .vpcName("the-first-vpc") .cidrBlock("172.16.0.0/12") .build()); var second = new Network("second", NetworkArgs.builder() .vpcName("the-second-vpc") .cidrBlock("172.16.0.0/16") .build()); var eu = new Provider("eu", ProviderArgs.builder() .region("eu-central-1") .build()); var third = new Network("third", NetworkArgs.builder() .vpcName("the-third-vpc") .cidrBlock("172.16.0.0/16") .build(), CustomResourceOptions.builder() .provider(alicloud.eu()) .build()); var zone_attachment = new ZoneAttachment("zone-attachment", ZoneAttachmentArgs.builder() .zoneId(zone.id()) .vpcs( ZoneAttachmentVpcArgs.builder() .vpcId(first.id()) .build(), ZoneAttachmentVpcArgs.builder() .vpcId(second.id()) .build(), ZoneAttachmentVpcArgs.builder() .regionId("eu-central-1") .vpcId(third.id()) .build()) .build()); } } ``` ## Import Private Zone attachment can be imported using the id(same with `zone_id`), e.g. ```sh $ pulumi import alicloud:pvtz/zoneAttachment:ZoneAttachment example abc123456 ```
-
-
Constructor Summary
Constructors Constructor Description ZoneAttachment(java.lang.String name)
ZoneAttachment(java.lang.String name, ZoneAttachmentArgs args)
ZoneAttachment(java.lang.String name, ZoneAttachmentArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZoneAttachment
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ZoneAttachmentState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.lang.String>>
lang()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
userClientIp()
com.pulumi.core.Output<java.util.List<java.lang.String>>
vpcIds()
com.pulumi.core.Output<java.util.List<ZoneAttachmentVpc>>
vpcs()
com.pulumi.core.Output<java.lang.String>
zoneId()
-
-
-
Constructor Detail
-
ZoneAttachment
public ZoneAttachment(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
ZoneAttachment
public ZoneAttachment(java.lang.String name, ZoneAttachmentArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
ZoneAttachment
public ZoneAttachment(java.lang.String name, ZoneAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
lang
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> lang()
- Returns:
- The language of code.
-
userClientIp
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> userClientIp()
- Returns:
- The user custom IP address.
-
vpcIds
public com.pulumi.core.Output<java.util.List<java.lang.String>> vpcIds()
- Returns:
- The id List of the VPC with the same region, for example:["vpc-1","vpc-2"].
-
vpcs
public com.pulumi.core.Output<java.util.List<ZoneAttachmentVpc>> vpcs()
- Returns:
- See `vpcs` below.Recommend to use `vpcs`.
-
zoneId
public com.pulumi.core.Output<java.lang.String> zoneId()
- Returns:
- The name of the Private Zone Record.
-
get
public static ZoneAttachment get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ZoneAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-