com.pulumi.alicloud.privatelink.VpcEndpointServiceConnection 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.privatelink;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.privatelink.VpcEndpointServiceConnectionArgs;
import com.pulumi.alicloud.privatelink.inputs.VpcEndpointServiceConnectionState;
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.Optional;
import javax.annotation.Nullable;
/**
* Provides a Private Link Vpc Endpoint Connection resource. vpc endpoint connection.
*
* For information about Private Link Vpc Endpoint Connection and how to use it, see [What is Vpc Endpoint Connection](https://www.alibabacloud.com/help/en/privatelink/latest/api-privatelink-2020-04-15-enablevpcendpointzoneconnection).
*
* > **NOTE:** Available since v1.110.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.AlicloudFunctions;
* import com.pulumi.alicloud.inputs.GetZonesArgs;
* import com.pulumi.alicloud.privatelink.VpcEndpointService;
* import com.pulumi.alicloud.privatelink.VpcEndpointServiceArgs;
* import com.pulumi.alicloud.vpc.Network;
* import com.pulumi.alicloud.vpc.NetworkArgs;
* import com.pulumi.alicloud.vpc.Switch;
* import com.pulumi.alicloud.vpc.SwitchArgs;
* import com.pulumi.alicloud.ecs.SecurityGroup;
* import com.pulumi.alicloud.ecs.SecurityGroupArgs;
* import com.pulumi.alicloud.slb.ApplicationLoadBalancer;
* import com.pulumi.alicloud.slb.ApplicationLoadBalancerArgs;
* import com.pulumi.alicloud.privatelink.VpcEndpointServiceResource;
* import com.pulumi.alicloud.privatelink.VpcEndpointServiceResourceArgs;
* import com.pulumi.alicloud.privatelink.VpcEndpoint;
* import com.pulumi.alicloud.privatelink.VpcEndpointArgs;
* import com.pulumi.alicloud.privatelink.VpcEndpointServiceConnection;
* import com.pulumi.alicloud.privatelink.VpcEndpointServiceConnectionArgs;
* 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) {
* final var config = ctx.config();
* final var name = config.get("name").orElse("tf_example");
* final var example = AlicloudFunctions.getZones(GetZonesArgs.builder()
* .availableResourceCreation("VSwitch")
* .build());
*
* var exampleVpcEndpointService = new VpcEndpointService("exampleVpcEndpointService", VpcEndpointServiceArgs.builder()
* .serviceDescription(name)
* .connectBandwidth(103)
* .autoAcceptConnection(false)
* .build());
*
* var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
* .vpcName(name)
* .cidrBlock("10.0.0.0/8")
* .build());
*
* var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
* .vswitchName(name)
* .cidrBlock("10.1.0.0/16")
* .vpcId(exampleNetwork.id())
* .zoneId(example.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
* .build());
*
* var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder()
* .name(name)
* .vpcId(exampleNetwork.id())
* .build());
*
* var exampleApplicationLoadBalancer = new ApplicationLoadBalancer("exampleApplicationLoadBalancer", ApplicationLoadBalancerArgs.builder()
* .loadBalancerName(name)
* .vswitchId(exampleSwitch.id())
* .loadBalancerSpec("slb.s2.small")
* .addressType("intranet")
* .build());
*
* var exampleVpcEndpointServiceResource = new VpcEndpointServiceResource("exampleVpcEndpointServiceResource", VpcEndpointServiceResourceArgs.builder()
* .serviceId(exampleVpcEndpointService.id())
* .resourceId(exampleApplicationLoadBalancer.id())
* .resourceType("slb")
* .build());
*
* var exampleVpcEndpoint = new VpcEndpoint("exampleVpcEndpoint", VpcEndpointArgs.builder()
* .serviceId(exampleVpcEndpointServiceResource.serviceId())
* .securityGroupIds(exampleSecurityGroup.id())
* .vpcId(exampleNetwork.id())
* .vpcEndpointName(name)
* .build());
*
* var exampleVpcEndpointServiceConnection = new VpcEndpointServiceConnection("exampleVpcEndpointServiceConnection", VpcEndpointServiceConnectionArgs.builder()
* .endpointId(exampleVpcEndpoint.id())
* .serviceId(exampleVpcEndpoint.serviceId())
* .bandwidth("1024")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Private Link Vpc Endpoint Connection can be imported using the id, e.g.
*
* ```sh
* $ pulumi import alicloud:privatelink/vpcEndpointServiceConnection:VpcEndpointServiceConnection example <service_id>:<endpoint_id>
* ```
*
*/
@ResourceType(type="alicloud:privatelink/vpcEndpointServiceConnection:VpcEndpointServiceConnection")
public class VpcEndpointServiceConnection extends com.pulumi.resources.CustomResource {
/**
* The bandwidth of the endpoint connection. Valid values: 100 to 10240. Unit: Mbit/s.Note: The bandwidth of an endpoint connection is in the range of 100 to 10,240 Mbit/s. The default bandwidth is 1,024 Mbit/s. When the endpoint is connected to the endpoint service, the default bandwidth is the minimum bandwidth. In this case, the connection bandwidth range is 1,024 to 10,240 Mbit/s.
*
*/
@Export(name="bandwidth", refs={Integer.class}, tree="[0]")
private Output bandwidth;
/**
* @return The bandwidth of the endpoint connection. Valid values: 100 to 10240. Unit: Mbit/s.Note: The bandwidth of an endpoint connection is in the range of 100 to 10,240 Mbit/s. The default bandwidth is 1,024 Mbit/s. When the endpoint is connected to the endpoint service, the default bandwidth is the minimum bandwidth. In this case, the connection bandwidth range is 1,024 to 10,240 Mbit/s.
*
*/
public Output bandwidth() {
return this.bandwidth;
}
/**
* Specifies whether to perform only a dry run, without performing the actual request. Valid values:
* - **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
* - **false (default)**: performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
*
*/
@Export(name="dryRun", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> dryRun;
/**
* @return Specifies whether to perform only a dry run, without performing the actual request. Valid values:
* - **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
* - **false (default)**: performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
*
*/
public Output> dryRun() {
return Codegen.optional(this.dryRun);
}
/**
* The endpoint ID.
*
*/
@Export(name="endpointId", refs={String.class}, tree="[0]")
private Output endpointId;
/**
* @return The endpoint ID.
*
*/
public Output endpointId() {
return this.endpointId;
}
/**
* The endpoint service ID.
*
*/
@Export(name="serviceId", refs={String.class}, tree="[0]")
private Output serviceId;
/**
* @return The endpoint service ID.
*
*/
public Output serviceId() {
return this.serviceId;
}
/**
* The state of the endpoint connection.
*
*/
@Export(name="status", refs={String.class}, tree="[0]")
private Output status;
/**
* @return The state of the endpoint connection.
*
*/
public Output status() {
return this.status;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public VpcEndpointServiceConnection(java.lang.String name) {
this(name, VpcEndpointServiceConnectionArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public VpcEndpointServiceConnection(java.lang.String name, VpcEndpointServiceConnectionArgs 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 VpcEndpointServiceConnection(java.lang.String name, VpcEndpointServiceConnectionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:privatelink/vpcEndpointServiceConnection:VpcEndpointServiceConnection", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private VpcEndpointServiceConnection(java.lang.String name, Output id, @Nullable VpcEndpointServiceConnectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:privatelink/vpcEndpointServiceConnection:VpcEndpointServiceConnection", name, state, makeResourceOptions(options, id), false);
}
private static VpcEndpointServiceConnectionArgs makeArgs(VpcEndpointServiceConnectionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? VpcEndpointServiceConnectionArgs.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 VpcEndpointServiceConnection get(java.lang.String name, Output id, @Nullable VpcEndpointServiceConnectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new VpcEndpointServiceConnection(name, id, state, options);
}
}