1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpc
  5. GatewayEndpoint
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.vpc.GatewayEndpoint

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a VPC Gateway Endpoint resource. VPC gateway endpoint.

    For information about VPC Gateway Endpoint and how to use it, see What is Gateway Endpoint.

    NOTE: Available since v1.208.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const domain = config.get("domain") || "com.aliyun.cn-hangzhou.oss";
    const defaultVpc = new alicloud.vpc.Network("defaultVpc", {description: "tf-example"});
    const defaultRg = new alicloud.resourcemanager.ResourceGroup("defaultRg", {
        displayName: "tf-example-497",
        resourceGroupName: name,
    });
    const _default = new alicloud.vpc.GatewayEndpoint("default", {
        gatewayEndpointDescrption: "test-gateway-endpoint",
        gatewayEndpointName: name,
        vpcId: defaultVpc.id,
        resourceGroupId: defaultRg.id,
        serviceName: domain,
        policyDocument: `      {
            "Version": "1",
            "Statement": [{
              "Effect": "Allow",
              "Resource": ["*"],
              "Action": ["*"],
              "Principal": ["*"]
            }]
          }
    `,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    domain = config.get("domain")
    if domain is None:
        domain = "com.aliyun.cn-hangzhou.oss"
    default_vpc = alicloud.vpc.Network("defaultVpc", description="tf-example")
    default_rg = alicloud.resourcemanager.ResourceGroup("defaultRg",
        display_name="tf-example-497",
        resource_group_name=name)
    default = alicloud.vpc.GatewayEndpoint("default",
        gateway_endpoint_descrption="test-gateway-endpoint",
        gateway_endpoint_name=name,
        vpc_id=default_vpc.id,
        resource_group_id=default_rg.id,
        service_name=domain,
        policy_document="""      {
            "Version": "1",
            "Statement": [{
              "Effect": "Allow",
              "Resource": ["*"],
              "Action": ["*"],
              "Principal": ["*"]
            }]
          }
    """)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		domain := "com.aliyun.cn-hangzhou.oss"
    		if param := cfg.Get("domain"); param != "" {
    			domain = param
    		}
    		defaultVpc, err := vpc.NewNetwork(ctx, "defaultVpc", &vpc.NetworkArgs{
    			Description: pulumi.String("tf-example"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultRg, err := resourcemanager.NewResourceGroup(ctx, "defaultRg", &resourcemanager.ResourceGroupArgs{
    			DisplayName:       pulumi.String("tf-example-497"),
    			ResourceGroupName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewGatewayEndpoint(ctx, "default", &vpc.GatewayEndpointArgs{
    			GatewayEndpointDescrption: pulumi.String("test-gateway-endpoint"),
    			GatewayEndpointName:       pulumi.String(name),
    			VpcId:                     defaultVpc.ID(),
    			ResourceGroupId:           defaultRg.ID(),
    			ServiceName:               pulumi.String(domain),
    			PolicyDocument: pulumi.String(`      {
            "Version": "1",
            "Statement": [{
              "Effect": "Allow",
              "Resource": ["*"],
              "Action": ["*"],
              "Principal": ["*"]
            }]
          }
    `),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var domain = config.Get("domain") ?? "com.aliyun.cn-hangzhou.oss";
        var defaultVpc = new AliCloud.Vpc.Network("defaultVpc", new()
        {
            Description = "tf-example",
        });
    
        var defaultRg = new AliCloud.ResourceManager.ResourceGroup("defaultRg", new()
        {
            DisplayName = "tf-example-497",
            ResourceGroupName = name,
        });
    
        var @default = new AliCloud.Vpc.GatewayEndpoint("default", new()
        {
            GatewayEndpointDescrption = "test-gateway-endpoint",
            GatewayEndpointName = name,
            VpcId = defaultVpc.Id,
            ResourceGroupId = defaultRg.Id,
            ServiceName = domain,
            PolicyDocument = @"      {
            ""Version"": ""1"",
            ""Statement"": [{
              ""Effect"": ""Allow"",
              ""Resource"": [""*""],
              ""Action"": [""*""],
              ""Principal"": [""*""]
            }]
          }
    ",
        });
    
    });
    
    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.resourcemanager.ResourceGroup;
    import com.pulumi.alicloud.resourcemanager.ResourceGroupArgs;
    import com.pulumi.alicloud.vpc.GatewayEndpoint;
    import com.pulumi.alicloud.vpc.GatewayEndpointArgs;
    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("terraform-example");
            final var domain = config.get("domain").orElse("com.aliyun.cn-hangzhou.oss");
            var defaultVpc = new Network("defaultVpc", NetworkArgs.builder()
                .description("tf-example")
                .build());
    
            var defaultRg = new ResourceGroup("defaultRg", ResourceGroupArgs.builder()
                .displayName("tf-example-497")
                .resourceGroupName(name)
                .build());
    
            var default_ = new GatewayEndpoint("default", GatewayEndpointArgs.builder()
                .gatewayEndpointDescrption("test-gateway-endpoint")
                .gatewayEndpointName(name)
                .vpcId(defaultVpc.id())
                .resourceGroupId(defaultRg.id())
                .serviceName(domain)
                .policyDocument("""
          {
            "Version": "1",
            "Statement": [{
              "Effect": "Allow",
              "Resource": ["*"],
              "Action": ["*"],
              "Principal": ["*"]
            }]
          }
                """)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
      domain:
        type: string
        default: com.aliyun.cn-hangzhou.oss
    resources:
      defaultVpc:
        type: alicloud:vpc:Network
        properties:
          description: tf-example
      defaultRg:
        type: alicloud:resourcemanager:ResourceGroup
        properties:
          displayName: tf-example-497
          resourceGroupName: ${name}
      default:
        type: alicloud:vpc:GatewayEndpoint
        properties:
          gatewayEndpointDescrption: test-gateway-endpoint
          gatewayEndpointName: ${name}
          vpcId: ${defaultVpc.id}
          resourceGroupId: ${defaultRg.id}
          serviceName: ${domain}
          policyDocument: |2
                  {
                    "Version": "1",
                    "Statement": [{
                      "Effect": "Allow",
                      "Resource": ["*"],
                      "Action": ["*"],
                      "Principal": ["*"]
                    }]
                  }
    

    Create GatewayEndpoint Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GatewayEndpoint(name: string, args: GatewayEndpointArgs, opts?: CustomResourceOptions);
    @overload
    def GatewayEndpoint(resource_name: str,
                        args: GatewayEndpointArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def GatewayEndpoint(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        service_name: Optional[str] = None,
                        vpc_id: Optional[str] = None,
                        gateway_endpoint_descrption: Optional[str] = None,
                        gateway_endpoint_name: Optional[str] = None,
                        policy_document: Optional[str] = None,
                        resource_group_id: Optional[str] = None,
                        tags: Optional[Mapping[str, Any]] = None)
    func NewGatewayEndpoint(ctx *Context, name string, args GatewayEndpointArgs, opts ...ResourceOption) (*GatewayEndpoint, error)
    public GatewayEndpoint(string name, GatewayEndpointArgs args, CustomResourceOptions? opts = null)
    public GatewayEndpoint(String name, GatewayEndpointArgs args)
    public GatewayEndpoint(String name, GatewayEndpointArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:GatewayEndpoint
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GatewayEndpointArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GatewayEndpointArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GatewayEndpointArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GatewayEndpointArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GatewayEndpointArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var gatewayEndpointResource = new AliCloud.Vpc.GatewayEndpoint("gatewayEndpointResource", new()
    {
        ServiceName = "string",
        VpcId = "string",
        GatewayEndpointDescrption = "string",
        GatewayEndpointName = "string",
        PolicyDocument = "string",
        ResourceGroupId = "string",
        Tags = 
        {
            { "string", "any" },
        },
    });
    
    example, err := vpc.NewGatewayEndpoint(ctx, "gatewayEndpointResource", &vpc.GatewayEndpointArgs{
    	ServiceName:               pulumi.String("string"),
    	VpcId:                     pulumi.String("string"),
    	GatewayEndpointDescrption: pulumi.String("string"),
    	GatewayEndpointName:       pulumi.String("string"),
    	PolicyDocument:            pulumi.String("string"),
    	ResourceGroupId:           pulumi.String("string"),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var gatewayEndpointResource = new GatewayEndpoint("gatewayEndpointResource", GatewayEndpointArgs.builder()
        .serviceName("string")
        .vpcId("string")
        .gatewayEndpointDescrption("string")
        .gatewayEndpointName("string")
        .policyDocument("string")
        .resourceGroupId("string")
        .tags(Map.of("string", "any"))
        .build());
    
    gateway_endpoint_resource = alicloud.vpc.GatewayEndpoint("gatewayEndpointResource",
        service_name="string",
        vpc_id="string",
        gateway_endpoint_descrption="string",
        gateway_endpoint_name="string",
        policy_document="string",
        resource_group_id="string",
        tags={
            "string": "any",
        })
    
    const gatewayEndpointResource = new alicloud.vpc.GatewayEndpoint("gatewayEndpointResource", {
        serviceName: "string",
        vpcId: "string",
        gatewayEndpointDescrption: "string",
        gatewayEndpointName: "string",
        policyDocument: "string",
        resourceGroupId: "string",
        tags: {
            string: "any",
        },
    });
    
    type: alicloud:vpc:GatewayEndpoint
    properties:
        gatewayEndpointDescrption: string
        gatewayEndpointName: string
        policyDocument: string
        resourceGroupId: string
        serviceName: string
        tags:
            string: any
        vpcId: string
    

    GatewayEndpoint Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The GatewayEndpoint resource accepts the following input properties:

    ServiceName string
    The name of endpoint service.
    VpcId string
    The ID of the VPC.
    GatewayEndpointDescrption string
    The description of the gateway endpoint.
    GatewayEndpointName string
    The name of the gateway endpoint.
    PolicyDocument string
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    ResourceGroupId string
    The ID of the resource group to which the instance belongs.
    Tags Dictionary<string, object>
    The tags of the resource.
    ServiceName string
    The name of endpoint service.
    VpcId string
    The ID of the VPC.
    GatewayEndpointDescrption string
    The description of the gateway endpoint.
    GatewayEndpointName string
    The name of the gateway endpoint.
    PolicyDocument string
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    ResourceGroupId string
    The ID of the resource group to which the instance belongs.
    Tags map[string]interface{}
    The tags of the resource.
    serviceName String
    The name of endpoint service.
    vpcId String
    The ID of the VPC.
    gatewayEndpointDescrption String
    The description of the gateway endpoint.
    gatewayEndpointName String
    The name of the gateway endpoint.
    policyDocument String
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    resourceGroupId String
    The ID of the resource group to which the instance belongs.
    tags Map<String,Object>
    The tags of the resource.
    serviceName string
    The name of endpoint service.
    vpcId string
    The ID of the VPC.
    gatewayEndpointDescrption string
    The description of the gateway endpoint.
    gatewayEndpointName string
    The name of the gateway endpoint.
    policyDocument string
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    resourceGroupId string
    The ID of the resource group to which the instance belongs.
    tags {[key: string]: any}
    The tags of the resource.
    service_name str
    The name of endpoint service.
    vpc_id str
    The ID of the VPC.
    gateway_endpoint_descrption str
    The description of the gateway endpoint.
    gateway_endpoint_name str
    The name of the gateway endpoint.
    policy_document str
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    resource_group_id str
    The ID of the resource group to which the instance belongs.
    tags Mapping[str, Any]
    The tags of the resource.
    serviceName String
    The name of endpoint service.
    vpcId String
    The ID of the VPC.
    gatewayEndpointDescrption String
    The description of the gateway endpoint.
    gatewayEndpointName String
    The name of the gateway endpoint.
    policyDocument String
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    resourceGroupId String
    The ID of the resource group to which the instance belongs.
    tags Map<Any>
    The tags of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GatewayEndpoint resource produces the following output properties:

    CreateTime string
    The creation time of the gateway endpoint.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of VPC gateway endpoint.
    CreateTime string
    The creation time of the gateway endpoint.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of VPC gateway endpoint.
    createTime String
    The creation time of the gateway endpoint.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of VPC gateway endpoint.
    createTime string
    The creation time of the gateway endpoint.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of VPC gateway endpoint.
    create_time str
    The creation time of the gateway endpoint.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of VPC gateway endpoint.
    createTime String
    The creation time of the gateway endpoint.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of VPC gateway endpoint.

    Look up Existing GatewayEndpoint Resource

    Get an existing GatewayEndpoint resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GatewayEndpointState, opts?: CustomResourceOptions): GatewayEndpoint
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            gateway_endpoint_descrption: Optional[str] = None,
            gateway_endpoint_name: Optional[str] = None,
            policy_document: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            service_name: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None,
            vpc_id: Optional[str] = None) -> GatewayEndpoint
    func GetGatewayEndpoint(ctx *Context, name string, id IDInput, state *GatewayEndpointState, opts ...ResourceOption) (*GatewayEndpoint, error)
    public static GatewayEndpoint Get(string name, Input<string> id, GatewayEndpointState? state, CustomResourceOptions? opts = null)
    public static GatewayEndpoint get(String name, Output<String> id, GatewayEndpointState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CreateTime string
    The creation time of the gateway endpoint.
    GatewayEndpointDescrption string
    The description of the gateway endpoint.
    GatewayEndpointName string
    The name of the gateway endpoint.
    PolicyDocument string
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    ResourceGroupId string
    The ID of the resource group to which the instance belongs.
    ServiceName string
    The name of endpoint service.
    Status string
    The status of VPC gateway endpoint.
    Tags Dictionary<string, object>
    The tags of the resource.
    VpcId string
    The ID of the VPC.
    CreateTime string
    The creation time of the gateway endpoint.
    GatewayEndpointDescrption string
    The description of the gateway endpoint.
    GatewayEndpointName string
    The name of the gateway endpoint.
    PolicyDocument string
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    ResourceGroupId string
    The ID of the resource group to which the instance belongs.
    ServiceName string
    The name of endpoint service.
    Status string
    The status of VPC gateway endpoint.
    Tags map[string]interface{}
    The tags of the resource.
    VpcId string
    The ID of the VPC.
    createTime String
    The creation time of the gateway endpoint.
    gatewayEndpointDescrption String
    The description of the gateway endpoint.
    gatewayEndpointName String
    The name of the gateway endpoint.
    policyDocument String
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    resourceGroupId String
    The ID of the resource group to which the instance belongs.
    serviceName String
    The name of endpoint service.
    status String
    The status of VPC gateway endpoint.
    tags Map<String,Object>
    The tags of the resource.
    vpcId String
    The ID of the VPC.
    createTime string
    The creation time of the gateway endpoint.
    gatewayEndpointDescrption string
    The description of the gateway endpoint.
    gatewayEndpointName string
    The name of the gateway endpoint.
    policyDocument string
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    resourceGroupId string
    The ID of the resource group to which the instance belongs.
    serviceName string
    The name of endpoint service.
    status string
    The status of VPC gateway endpoint.
    tags {[key: string]: any}
    The tags of the resource.
    vpcId string
    The ID of the VPC.
    create_time str
    The creation time of the gateway endpoint.
    gateway_endpoint_descrption str
    The description of the gateway endpoint.
    gateway_endpoint_name str
    The name of the gateway endpoint.
    policy_document str
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    resource_group_id str
    The ID of the resource group to which the instance belongs.
    service_name str
    The name of endpoint service.
    status str
    The status of VPC gateway endpoint.
    tags Mapping[str, Any]
    The tags of the resource.
    vpc_id str
    The ID of the VPC.
    createTime String
    The creation time of the gateway endpoint.
    gatewayEndpointDescrption String
    The description of the gateway endpoint.
    gatewayEndpointName String
    The name of the gateway endpoint.
    policyDocument String
    Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see syntax and structure of permission Policies.
    resourceGroupId String
    The ID of the resource group to which the instance belongs.
    serviceName String
    The name of endpoint service.
    status String
    The status of VPC gateway endpoint.
    tags Map<Any>
    The tags of the resource.
    vpcId String
    The ID of the VPC.

    Import

    VPC Gateway Endpoint can be imported using the id, e.g.

    $ pulumi import alicloud:vpc/gatewayEndpoint:GatewayEndpoint example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi