alicloud.cen.Instance
Explore with Pulumi AI
Provides a Cloud Enterprise Network (CEN) Instance resource.
For information about Cloud Enterprise Network (CEN) Instance and how to use it, see What is Instance.
NOTE: Available since v1.15.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 _default = new alicloud.cen.Instance("default", {
cenInstanceName: name,
description: name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.cen.Instance("default",
cen_instance_name=name,
description=name)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
"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
}
_, err := cen.NewInstance(ctx, "default", &cen.InstanceArgs{
CenInstanceName: pulumi.String(name),
Description: pulumi.String(name),
})
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 @default = new AliCloud.Cen.Instance("default", new()
{
CenInstanceName = name,
Description = name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cen.Instance;
import com.pulumi.alicloud.cen.InstanceArgs;
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 default_ = new Instance("default", InstanceArgs.builder()
.cenInstanceName(name)
.description(name)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:cen:Instance
properties:
cenInstanceName: ${name}
description: ${name}
Create Instance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Instance(name: string, args?: InstanceArgs, opts?: CustomResourceOptions);
@overload
def Instance(resource_name: str,
args: Optional[InstanceArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Instance(resource_name: str,
opts: Optional[ResourceOptions] = None,
cen_instance_name: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
protection_level: Optional[str] = None,
resource_group_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewInstance(ctx *Context, name string, args *InstanceArgs, opts ...ResourceOption) (*Instance, error)
public Instance(string name, InstanceArgs? args = null, CustomResourceOptions? opts = null)
public Instance(String name, InstanceArgs args)
public Instance(String name, InstanceArgs args, CustomResourceOptions options)
type: alicloud:cen:Instance
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 InstanceArgs
- 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 InstanceArgs
- 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 InstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InstanceArgs
- 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 exampleinstanceResourceResourceFromCeninstance = new AliCloud.Cen.Instance("exampleinstanceResourceResourceFromCeninstance", new()
{
CenInstanceName = "string",
Description = "string",
ProtectionLevel = "string",
ResourceGroupId = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := cen.NewInstance(ctx, "exampleinstanceResourceResourceFromCeninstance", &cen.InstanceArgs{
CenInstanceName: pulumi.String("string"),
Description: pulumi.String("string"),
ProtectionLevel: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var exampleinstanceResourceResourceFromCeninstance = new Instance("exampleinstanceResourceResourceFromCeninstance", InstanceArgs.builder()
.cenInstanceName("string")
.description("string")
.protectionLevel("string")
.resourceGroupId("string")
.tags(Map.of("string", "string"))
.build());
exampleinstance_resource_resource_from_ceninstance = alicloud.cen.Instance("exampleinstanceResourceResourceFromCeninstance",
cen_instance_name="string",
description="string",
protection_level="string",
resource_group_id="string",
tags={
"string": "string",
})
const exampleinstanceResourceResourceFromCeninstance = new alicloud.cen.Instance("exampleinstanceResourceResourceFromCeninstance", {
cenInstanceName: "string",
description: "string",
protectionLevel: "string",
resourceGroupId: "string",
tags: {
string: "string",
},
});
type: alicloud:cen:Instance
properties:
cenInstanceName: string
description: string
protectionLevel: string
resourceGroupId: string
tags:
string: string
Instance 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 Instance resource accepts the following input properties:
- Cen
Instance stringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - Description string
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - Name string
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - Protection
Level string - The level of CIDR block overlapping. Default value:
REDUCE
. - Resource
Group stringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Cen
Instance stringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - Description string
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - Name string
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - Protection
Level string - The level of CIDR block overlapping. Default value:
REDUCE
. - Resource
Group stringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- map[string]string
- A mapping of tags to assign to the resource.
- cen
Instance StringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - description String
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - name String
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - protection
Level String - The level of CIDR block overlapping. Default value:
REDUCE
. - resource
Group StringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- Map<String,String>
- A mapping of tags to assign to the resource.
- cen
Instance stringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - description string
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - name string
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - protection
Level string - The level of CIDR block overlapping. Default value:
REDUCE
. - resource
Group stringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- cen_
instance_ strname - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - description str
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - name str
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - protection_
level str - The level of CIDR block overlapping. Default value:
REDUCE
. - resource_
group_ strid - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- cen
Instance StringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - description String
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - name String
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - protection
Level String - The level of CIDR block overlapping. Default value:
REDUCE
. - resource
Group StringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- Map<String>
- A mapping of tags to assign to the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Instance resource produces the following output properties:
Look up Existing Instance Resource
Get an existing Instance 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?: InstanceState, opts?: CustomResourceOptions): Instance
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cen_instance_name: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
protection_level: Optional[str] = None,
resource_group_id: Optional[str] = None,
status: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None) -> Instance
func GetInstance(ctx *Context, name string, id IDInput, state *InstanceState, opts ...ResourceOption) (*Instance, error)
public static Instance Get(string name, Input<string> id, InstanceState? state, CustomResourceOptions? opts = null)
public static Instance get(String name, Output<String> id, InstanceState 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.
- Cen
Instance stringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - Description string
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - Name string
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - Protection
Level string - The level of CIDR block overlapping. Default value:
REDUCE
. - Resource
Group stringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- Status string
- The status of the Instance.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Cen
Instance stringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - Description string
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - Name string
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - Protection
Level string - The level of CIDR block overlapping. Default value:
REDUCE
. - Resource
Group stringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- Status string
- The status of the Instance.
- map[string]string
- A mapping of tags to assign to the resource.
- cen
Instance StringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - description String
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - name String
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - protection
Level String - The level of CIDR block overlapping. Default value:
REDUCE
. - resource
Group StringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- status String
- The status of the Instance.
- Map<String,String>
- A mapping of tags to assign to the resource.
- cen
Instance stringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - description string
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - name string
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - protection
Level string - The level of CIDR block overlapping. Default value:
REDUCE
. - resource
Group stringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- status string
- The status of the Instance.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- cen_
instance_ strname - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - description str
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - name str
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - protection_
level str - The level of CIDR block overlapping. Default value:
REDUCE
. - resource_
group_ strid - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- status str
- The status of the Instance.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- cen
Instance StringName - The name of the CEN Instance. The name can be empty or
1
to128
characters in length and cannot start withhttp://
orhttps://
. - description String
- The description of the CEN Instance. The description can be empty or
1
to256
characters in length and cannot start withhttp://
orhttps://
. - name String
- Field
name
has been deprecated from provider version 1.98.0. New fieldcen_instance_name
instead. - protection
Level String - The level of CIDR block overlapping. Default value:
REDUCE
. - resource
Group StringId - The ID of the resource group. Note: Once you set a value of this property, you cannot set it to an empty string anymore.
- status String
- The status of the Instance.
- Map<String>
- A mapping of tags to assign to the resource.
Import
Cloud Enterprise Network (CEN) Instance can be imported using the id, e.g.
$ pulumi import alicloud:cen/instance:Instance 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.