1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. fc
  5. V3VpcBinding
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.fc.V3VpcBinding

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a FCV3 Vpc Binding resource.

    For information about FCV3 Vpc Binding and how to use it, see What is Vpc Binding.

    NOTE: Available since v1.230.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 vpc = new alicloud.vpc.Network("vpc", {
        cidrBlock: "10.0.0.0/8",
        vpcName: name,
    });
    const _function = new alicloud.fc.V3Function("function", {
        memorySize: 512,
        cpu: 0.5,
        handler: "index.Handler",
        code: {
            zipFile: "UEsDBBQACAAIAAAAAAAAAAAAAAAAAAAAAAAIAAAAaW5kZXgucHmEkEFKxEAQRfd9ig9ZTCJOooIwDMwNXLqXnnQlaalUhU5lRj2KZ/FOXkESGR114bJ/P/7jV4b1xRq1hijtFpM1682cuNgPmgysbRulPT0fRxXnMtwrSPyeCdYRokSLnuMLJTTkbUqEvDMbxm1VdcRD6Tk+T1LW2ldB66knsYdA5iNX17ebm6tN2VnPhcswMPmREPuBacb+CiapLarAj9gT6/H97dVlCNScY3mtYvRkxdZlwDKDEnanPWVLdrdkeXEGlFEazVdfPVHaVeHc3N15CUwppwOJXeK7HshAB8NuOU7J6sP4SRXuH/EvbUfMiqMmDqv5M5FNSfAj/wgAAP//UEsHCPl//NYAAQAArwEAAFBLAQIUABQACAAIAAAAAAD5f/zWAAEAAK8BAAAIAAAAAAAAAAAAAAAAAAAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAAA2AQAAAAA=",
        },
        functionName: name,
        runtime: "python3.9",
        diskSize: 512,
        logConfig: {
            logBeginRule: "None",
        },
    });
    const _default = new alicloud.fc.V3VpcBinding("default", {
        functionName: _function.functionName,
        vpcId: vpc.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    vpc = alicloud.vpc.Network("vpc",
        cidr_block="10.0.0.0/8",
        vpc_name=name)
    function = alicloud.fc.V3Function("function",
        memory_size=512,
        cpu=0.5,
        handler="index.Handler",
        code={
            "zip_file": "UEsDBBQACAAIAAAAAAAAAAAAAAAAAAAAAAAIAAAAaW5kZXgucHmEkEFKxEAQRfd9ig9ZTCJOooIwDMwNXLqXnnQlaalUhU5lRj2KZ/FOXkESGR114bJ/P/7jV4b1xRq1hijtFpM1682cuNgPmgysbRulPT0fRxXnMtwrSPyeCdYRokSLnuMLJTTkbUqEvDMbxm1VdcRD6Tk+T1LW2ldB66knsYdA5iNX17ebm6tN2VnPhcswMPmREPuBacb+CiapLarAj9gT6/H97dVlCNScY3mtYvRkxdZlwDKDEnanPWVLdrdkeXEGlFEazVdfPVHaVeHc3N15CUwppwOJXeK7HshAB8NuOU7J6sP4SRXuH/EvbUfMiqMmDqv5M5FNSfAj/wgAAP//UEsHCPl//NYAAQAArwEAAFBLAQIUABQACAAIAAAAAAD5f/zWAAEAAK8BAAAIAAAAAAAAAAAAAAAAAAAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAAA2AQAAAAA=",
        },
        function_name=name,
        runtime="python3.9",
        disk_size=512,
        log_config={
            "log_begin_rule": "None",
        })
    default = alicloud.fc.V3VpcBinding("default",
        function_name=function.function_name,
        vpc_id=vpc.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/fc"
    	"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
    		}
    		vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
    			CidrBlock: pulumi.String("10.0.0.0/8"),
    			VpcName:   pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		function, err := fc.NewV3Function(ctx, "function", &fc.V3FunctionArgs{
    			MemorySize: pulumi.Int(512),
    			Cpu:        pulumi.Float64(0.5),
    			Handler:    pulumi.String("index.Handler"),
    			Code: &fc.V3FunctionCodeArgs{
    				ZipFile: pulumi.String("UEsDBBQACAAIAAAAAAAAAAAAAAAAAAAAAAAIAAAAaW5kZXgucHmEkEFKxEAQRfd9ig9ZTCJOooIwDMwNXLqXnnQlaalUhU5lRj2KZ/FOXkESGR114bJ/P/7jV4b1xRq1hijtFpM1682cuNgPmgysbRulPT0fRxXnMtwrSPyeCdYRokSLnuMLJTTkbUqEvDMbxm1VdcRD6Tk+T1LW2ldB66knsYdA5iNX17ebm6tN2VnPhcswMPmREPuBacb+CiapLarAj9gT6/H97dVlCNScY3mtYvRkxdZlwDKDEnanPWVLdrdkeXEGlFEazVdfPVHaVeHc3N15CUwppwOJXeK7HshAB8NuOU7J6sP4SRXuH/EvbUfMiqMmDqv5M5FNSfAj/wgAAP//UEsHCPl//NYAAQAArwEAAFBLAQIUABQACAAIAAAAAAD5f/zWAAEAAK8BAAAIAAAAAAAAAAAAAAAAAAAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAAA2AQAAAAA="),
    			},
    			FunctionName: pulumi.String(name),
    			Runtime:      pulumi.String("python3.9"),
    			DiskSize:     pulumi.Int(512),
    			LogConfig: &fc.V3FunctionLogConfigArgs{
    				LogBeginRule: pulumi.String("None"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = fc.NewV3VpcBinding(ctx, "default", &fc.V3VpcBindingArgs{
    			FunctionName: function.FunctionName,
    			VpcId:        vpc.ID(),
    		})
    		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 vpc = new AliCloud.Vpc.Network("vpc", new()
        {
            CidrBlock = "10.0.0.0/8",
            VpcName = name,
        });
    
        var function = new AliCloud.FC.V3Function("function", new()
        {
            MemorySize = 512,
            Cpu = 0.5,
            Handler = "index.Handler",
            Code = new AliCloud.FC.Inputs.V3FunctionCodeArgs
            {
                ZipFile = "UEsDBBQACAAIAAAAAAAAAAAAAAAAAAAAAAAIAAAAaW5kZXgucHmEkEFKxEAQRfd9ig9ZTCJOooIwDMwNXLqXnnQlaalUhU5lRj2KZ/FOXkESGR114bJ/P/7jV4b1xRq1hijtFpM1682cuNgPmgysbRulPT0fRxXnMtwrSPyeCdYRokSLnuMLJTTkbUqEvDMbxm1VdcRD6Tk+T1LW2ldB66knsYdA5iNX17ebm6tN2VnPhcswMPmREPuBacb+CiapLarAj9gT6/H97dVlCNScY3mtYvRkxdZlwDKDEnanPWVLdrdkeXEGlFEazVdfPVHaVeHc3N15CUwppwOJXeK7HshAB8NuOU7J6sP4SRXuH/EvbUfMiqMmDqv5M5FNSfAj/wgAAP//UEsHCPl//NYAAQAArwEAAFBLAQIUABQACAAIAAAAAAD5f/zWAAEAAK8BAAAIAAAAAAAAAAAAAAAAAAAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAAA2AQAAAAA=",
            },
            FunctionName = name,
            Runtime = "python3.9",
            DiskSize = 512,
            LogConfig = new AliCloud.FC.Inputs.V3FunctionLogConfigArgs
            {
                LogBeginRule = "None",
            },
        });
    
        var @default = new AliCloud.FC.V3VpcBinding("default", new()
        {
            FunctionName = function.FunctionName,
            VpcId = vpc.Id,
        });
    
    });
    
    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.fc.V3Function;
    import com.pulumi.alicloud.fc.V3FunctionArgs;
    import com.pulumi.alicloud.fc.inputs.V3FunctionCodeArgs;
    import com.pulumi.alicloud.fc.inputs.V3FunctionLogConfigArgs;
    import com.pulumi.alicloud.fc.V3VpcBinding;
    import com.pulumi.alicloud.fc.V3VpcBindingArgs;
    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");
            var vpc = new Network("vpc", NetworkArgs.builder()
                .cidrBlock("10.0.0.0/8")
                .vpcName(name)
                .build());
    
            var function = new V3Function("function", V3FunctionArgs.builder()
                .memorySize("512")
                .cpu(0.5)
                .handler("index.Handler")
                .code(V3FunctionCodeArgs.builder()
                    .zipFile("UEsDBBQACAAIAAAAAAAAAAAAAAAAAAAAAAAIAAAAaW5kZXgucHmEkEFKxEAQRfd9ig9ZTCJOooIwDMwNXLqXnnQlaalUhU5lRj2KZ/FOXkESGR114bJ/P/7jV4b1xRq1hijtFpM1682cuNgPmgysbRulPT0fRxXnMtwrSPyeCdYRokSLnuMLJTTkbUqEvDMbxm1VdcRD6Tk+T1LW2ldB66knsYdA5iNX17ebm6tN2VnPhcswMPmREPuBacb+CiapLarAj9gT6/H97dVlCNScY3mtYvRkxdZlwDKDEnanPWVLdrdkeXEGlFEazVdfPVHaVeHc3N15CUwppwOJXeK7HshAB8NuOU7J6sP4SRXuH/EvbUfMiqMmDqv5M5FNSfAj/wgAAP//UEsHCPl//NYAAQAArwEAAFBLAQIUABQACAAIAAAAAAD5f/zWAAEAAK8BAAAIAAAAAAAAAAAAAAAAAAAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAAA2AQAAAAA=")
                    .build())
                .functionName(name)
                .runtime("python3.9")
                .diskSize("512")
                .logConfig(V3FunctionLogConfigArgs.builder()
                    .logBeginRule("None")
                    .build())
                .build());
    
            var default_ = new V3VpcBinding("default", V3VpcBindingArgs.builder()
                .functionName(function.functionName())
                .vpcId(vpc.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      vpc:
        type: alicloud:vpc:Network
        properties:
          cidrBlock: 10.0.0.0/8
          vpcName: ${name}
      function:
        type: alicloud:fc:V3Function
        properties:
          memorySize: '512'
          cpu: 0.5
          handler: index.Handler
          code:
            zipFile: UEsDBBQACAAIAAAAAAAAAAAAAAAAAAAAAAAIAAAAaW5kZXgucHmEkEFKxEAQRfd9ig9ZTCJOooIwDMwNXLqXnnQlaalUhU5lRj2KZ/FOXkESGR114bJ/P/7jV4b1xRq1hijtFpM1682cuNgPmgysbRulPT0fRxXnMtwrSPyeCdYRokSLnuMLJTTkbUqEvDMbxm1VdcRD6Tk+T1LW2ldB66knsYdA5iNX17ebm6tN2VnPhcswMPmREPuBacb+CiapLarAj9gT6/H97dVlCNScY3mtYvRkxdZlwDKDEnanPWVLdrdkeXEGlFEazVdfPVHaVeHc3N15CUwppwOJXeK7HshAB8NuOU7J6sP4SRXuH/EvbUfMiqMmDqv5M5FNSfAj/wgAAP//UEsHCPl//NYAAQAArwEAAFBLAQIUABQACAAIAAAAAAD5f/zWAAEAAK8BAAAIAAAAAAAAAAAAAAAAAAAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAAA2AQAAAAA=
          functionName: ${name}
          runtime: python3.9
          diskSize: '512'
          logConfig:
            logBeginRule: None
      default:
        type: alicloud:fc:V3VpcBinding
        properties:
          functionName: ${function.functionName}
          vpcId: ${vpc.id}
    

    Create V3VpcBinding Resource

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

    Constructor syntax

    new V3VpcBinding(name: string, args: V3VpcBindingArgs, opts?: CustomResourceOptions);
    @overload
    def V3VpcBinding(resource_name: str,
                     args: V3VpcBindingArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def V3VpcBinding(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     function_name: Optional[str] = None,
                     vpc_id: Optional[str] = None)
    func NewV3VpcBinding(ctx *Context, name string, args V3VpcBindingArgs, opts ...ResourceOption) (*V3VpcBinding, error)
    public V3VpcBinding(string name, V3VpcBindingArgs args, CustomResourceOptions? opts = null)
    public V3VpcBinding(String name, V3VpcBindingArgs args)
    public V3VpcBinding(String name, V3VpcBindingArgs args, CustomResourceOptions options)
    
    type: alicloud:fc:V3VpcBinding
    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 V3VpcBindingArgs
    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 V3VpcBindingArgs
    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 V3VpcBindingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args V3VpcBindingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args V3VpcBindingArgs
    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 v3vpcBindingResource = new AliCloud.FC.V3VpcBinding("v3vpcBindingResource", new()
    {
        FunctionName = "string",
        VpcId = "string",
    });
    
    example, err := fc.NewV3VpcBinding(ctx, "v3vpcBindingResource", &fc.V3VpcBindingArgs{
    	FunctionName: pulumi.String("string"),
    	VpcId:        pulumi.String("string"),
    })
    
    var v3vpcBindingResource = new V3VpcBinding("v3vpcBindingResource", V3VpcBindingArgs.builder()
        .functionName("string")
        .vpcId("string")
        .build());
    
    v3vpc_binding_resource = alicloud.fc.V3VpcBinding("v3vpcBindingResource",
        function_name="string",
        vpc_id="string")
    
    const v3vpcBindingResource = new alicloud.fc.V3VpcBinding("v3vpcBindingResource", {
        functionName: "string",
        vpcId: "string",
    });
    
    type: alicloud:fc:V3VpcBinding
    properties:
        functionName: string
        vpcId: string
    

    V3VpcBinding Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The V3VpcBinding resource accepts the following input properties:

    FunctionName string
    Function Name
    VpcId string
    VPC instance ID
    FunctionName string
    Function Name
    VpcId string
    VPC instance ID
    functionName String
    Function Name
    vpcId String
    VPC instance ID
    functionName string
    Function Name
    vpcId string
    VPC instance ID
    function_name str
    Function Name
    vpc_id str
    VPC instance ID
    functionName String
    Function Name
    vpcId String
    VPC instance ID

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing V3VpcBinding Resource

    Get an existing V3VpcBinding 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?: V3VpcBindingState, opts?: CustomResourceOptions): V3VpcBinding
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            function_name: Optional[str] = None,
            vpc_id: Optional[str] = None) -> V3VpcBinding
    func GetV3VpcBinding(ctx *Context, name string, id IDInput, state *V3VpcBindingState, opts ...ResourceOption) (*V3VpcBinding, error)
    public static V3VpcBinding Get(string name, Input<string> id, V3VpcBindingState? state, CustomResourceOptions? opts = null)
    public static V3VpcBinding get(String name, Output<String> id, V3VpcBindingState 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:
    FunctionName string
    Function Name
    VpcId string
    VPC instance ID
    FunctionName string
    Function Name
    VpcId string
    VPC instance ID
    functionName String
    Function Name
    vpcId String
    VPC instance ID
    functionName string
    Function Name
    vpcId string
    VPC instance ID
    function_name str
    Function Name
    vpc_id str
    VPC instance ID
    functionName String
    Function Name
    vpcId String
    VPC instance ID

    Import

    FCV3 Vpc Binding can be imported using the id, e.g.

    $ pulumi import alicloud:fc/v3VpcBinding:V3VpcBinding example <function_name>:<vpc_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.66.0 published on Friday, Nov 15, 2024 by Pulumi