com.pulumi.alicloud.vpc.GatewayRouteTableAttachment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alicloud Show documentation
Show all versions of alicloud Show documentation
A Pulumi package for creating and managing AliCloud 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.alicloud.vpc;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.vpc.GatewayRouteTableAttachmentArgs;
import com.pulumi.alicloud.vpc.inputs.GatewayRouteTableAttachmentState;
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.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Provides a VPC Gateway Route Table Attachment resource.
*
* For information about VPC Gateway Route Table Attachment and how to use it, see [What is Gateway Route Table Attachment](https://www.alibabacloud.com/help/doc-detail/174112.htm).
*
* > **NOTE:** Available in v1.194.0+.
*
* ## Example Usage
*
* Basic Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.alicloud.vpc.Network;
* import com.pulumi.alicloud.vpc.NetworkArgs;
* import com.pulumi.alicloud.vpc.RouteTable;
* import com.pulumi.alicloud.vpc.RouteTableArgs;
* import com.pulumi.alicloud.vpc.Ipv4Gateway;
* import com.pulumi.alicloud.vpc.Ipv4GatewayArgs;
* import com.pulumi.alicloud.vpc.GatewayRouteTableAttachment;
* import com.pulumi.alicloud.vpc.GatewayRouteTableAttachmentArgs;
* 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 example = new Network("example", NetworkArgs.builder()
* .cidrBlock("172.16.0.0/12")
* .vpcName("terraform-example")
* .build());
*
* var exampleRouteTable = new RouteTable("exampleRouteTable", RouteTableArgs.builder()
* .vpcId(example.id())
* .routeTableName("terraform-example")
* .description("terraform-example")
* .associateType("Gateway")
* .build());
*
* var exampleIpv4Gateway = new Ipv4Gateway("exampleIpv4Gateway", Ipv4GatewayArgs.builder()
* .ipv4GatewayName("terraform-example")
* .vpcId(example.id())
* .enabled("true")
* .build());
*
* var exampleGatewayRouteTableAttachment = new GatewayRouteTableAttachment("exampleGatewayRouteTableAttachment", GatewayRouteTableAttachmentArgs.builder()
* .ipv4GatewayId(exampleIpv4Gateway.id())
* .routeTableId(exampleRouteTable.id())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* VPC Gateway Route Table Attachment can be imported using the id, e.g.
*
* ```sh
* $ pulumi import alicloud:vpc/gatewayRouteTableAttachment:GatewayRouteTableAttachment example <route_table_id>:<ipv4_gateway_id>
* ```
*
*/
@ResourceType(type="alicloud:vpc/gatewayRouteTableAttachment:GatewayRouteTableAttachment")
public class GatewayRouteTableAttachment extends com.pulumi.resources.CustomResource {
/**
* The creation time of the resource.
*
*/
@Export(name="createTime", refs={String.class}, tree="[0]")
private Output createTime;
/**
* @return The creation time of the resource.
*
*/
public Output createTime() {
return this.createTime;
}
/**
* Specifies whether to only precheck this request. Default value: `false`.
*
*/
@Export(name="dryRun", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> dryRun;
/**
* @return Specifies whether to only precheck this request. Default value: `false`.
*
*/
public Output> dryRun() {
return Codegen.optional(this.dryRun);
}
/**
* The ID of the IPv4 Gateway instance.
*
*/
@Export(name="ipv4GatewayId", refs={String.class}, tree="[0]")
private Output ipv4GatewayId;
/**
* @return The ID of the IPv4 Gateway instance.
*
*/
public Output ipv4GatewayId() {
return this.ipv4GatewayId;
}
/**
* The ID of the Gateway route table to be bound.
*
*/
@Export(name="routeTableId", refs={String.class}, tree="[0]")
private Output routeTableId;
/**
* @return The ID of the Gateway route table to be bound.
*
*/
public Output routeTableId() {
return this.routeTableId;
}
/**
* The status of the IPv4 Gateway instance. Value:
* - **Creating**: The function is being created.
* - **Created**: Created and available.
* - **Modifying**: is being modified.
* - **Deleting**: Deleting.
* - **Deleted**: Deleted.
* - **Activating**: enabled.
*
*/
@Export(name="status", refs={String.class}, tree="[0]")
private Output status;
/**
* @return The status of the IPv4 Gateway instance. Value:
* - **Creating**: The function is being created.
* - **Created**: Created and available.
* - **Modifying**: is being modified.
* - **Deleting**: Deleting.
* - **Deleted**: Deleted.
* - **Activating**: enabled.
*
*/
public Output status() {
return this.status;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public GatewayRouteTableAttachment(java.lang.String name) {
this(name, GatewayRouteTableAttachmentArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public GatewayRouteTableAttachment(java.lang.String name, GatewayRouteTableAttachmentArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public GatewayRouteTableAttachment(java.lang.String name, GatewayRouteTableAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:vpc/gatewayRouteTableAttachment:GatewayRouteTableAttachment", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private GatewayRouteTableAttachment(java.lang.String name, Output id, @Nullable GatewayRouteTableAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:vpc/gatewayRouteTableAttachment:GatewayRouteTableAttachment", name, state, makeResourceOptions(options, id), false);
}
private static GatewayRouteTableAttachmentArgs makeArgs(GatewayRouteTableAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? GatewayRouteTableAttachmentArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static GatewayRouteTableAttachment get(java.lang.String name, Output id, @Nullable GatewayRouteTableAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new GatewayRouteTableAttachment(name, id, state, options);
}
}