title: "Secgroup" title_tag: "huaweicloud.Vpc.Secgroup" meta_desc: "Documentation for the huaweicloud.Vpc.Secgroup resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true


Import

Security Groups can be imported using the id, e.g.

 $ pulumi import huaweicloud:Vpc/secgroup:Secgroup secgroup_1 38809219-5e8a-4852-9139-6f461c90e8bc

Create Secgroup Resource {#create}

new Secgroup(name: string, args?: SecgroupArgs, opts?: CustomResourceOptions);
@overload
def Secgroup(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             delete_default_rules: Optional[bool] = None,
             description: Optional[str] = None,
             enterprise_project_id: Optional[str] = None,
             name: Optional[str] = None,
             region: Optional[str] = None)
@overload
def Secgroup(resource_name: str,
             args: Optional[SecgroupArgs] = None,
             opts: Optional[ResourceOptions] = None)
func NewSecgroup(ctx *Context, name string, args *SecgroupArgs, opts ...ResourceOption) (*Secgroup, error)
public Secgroup(string name, SecgroupArgs? args = null, CustomResourceOptions? opts = null)
public Secgroup(String name, SecgroupArgs args)
public Secgroup(String name, SecgroupArgs args, CustomResourceOptions options)
type: huaweicloud:Vpc:Secgroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SecgroupArgs
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 SecgroupArgs
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 SecgroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SecgroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SecgroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Secgroup Resource Properties {#properties}

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

Inputs

The Secgroup resource accepts the following input properties:

DeleteDefaultRules bool

Specifies whether or not to delete the default security rules. This is false by default.

Description string

Specifies the description for the security group.

EnterpriseProjectId string

Specifies the enterprise project id of the security group. Changing this creates a new security group.

Name string

Specifies a unique name for the security group.

Region string

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

DeleteDefaultRules bool

Specifies whether or not to delete the default security rules. This is false by default.

Description string

Specifies the description for the security group.

EnterpriseProjectId string

Specifies the enterprise project id of the security group. Changing this creates a new security group.

Name string

Specifies a unique name for the security group.

Region string

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

deleteDefaultRules Boolean

Specifies whether or not to delete the default security rules. This is false by default.

description String

Specifies the description for the security group.

enterpriseProjectId String

Specifies the enterprise project id of the security group. Changing this creates a new security group.

name String

Specifies a unique name for the security group.

region String

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

deleteDefaultRules boolean

Specifies whether or not to delete the default security rules. This is false by default.

description string

Specifies the description for the security group.

enterpriseProjectId string

Specifies the enterprise project id of the security group. Changing this creates a new security group.

name string

Specifies a unique name for the security group.

region string

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

delete_default_rules bool

Specifies whether or not to delete the default security rules. This is false by default.

description str

Specifies the description for the security group.

enterprise_project_id str

Specifies the enterprise project id of the security group. Changing this creates a new security group.

name str

Specifies a unique name for the security group.

region str

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

deleteDefaultRules Boolean

Specifies whether or not to delete the default security rules. This is false by default.

description String

Specifies the description for the security group.

enterpriseProjectId String

Specifies the enterprise project id of the security group. Changing this creates a new security group.

name String

Specifies a unique name for the security group.

region String

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

Outputs

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

CreatedAt string

The creation time, in UTC format.

Id string

The provider-assigned unique ID for this managed resource.

Rules List<SecgroupRule>

The array of security group rules associating with the security group. The rule object is documented below.

UpdatedAt string

The last update time, in UTC format.

CreatedAt string

The creation time, in UTC format.

Id string

The provider-assigned unique ID for this managed resource.

Rules []SecgroupRuleType

The array of security group rules associating with the security group. The rule object is documented below.

UpdatedAt string

The last update time, in UTC format.

createdAt String

The creation time, in UTC format.

id String

The provider-assigned unique ID for this managed resource.

rules List<SecgroupRule>

The array of security group rules associating with the security group. The rule object is documented below.

updatedAt String

The last update time, in UTC format.

createdAt string

The creation time, in UTC format.

id string

The provider-assigned unique ID for this managed resource.

rules SecgroupRule[]

The array of security group rules associating with the security group. The rule object is documented below.

updatedAt string

The last update time, in UTC format.

created_at str

The creation time, in UTC format.

id str

The provider-assigned unique ID for this managed resource.

rules SecgroupRule]

The array of security group rules associating with the security group. The rule object is documented below.

updated_at str

The last update time, in UTC format.

createdAt String

The creation time, in UTC format.

id String

The provider-assigned unique ID for this managed resource.

rules List<Property Map>

The array of security group rules associating with the security group. The rule object is documented below.

updatedAt String

The last update time, in UTC format.

Look up Existing Secgroup Resource {#look-up}

Get an existing Secgroup 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?: SecgroupState, opts?: CustomResourceOptions): Secgroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        delete_default_rules: Optional[bool] = None,
        description: Optional[str] = None,
        enterprise_project_id: Optional[str] = None,
        name: Optional[str] = None,
        region: Optional[str] = None,
        rules: Optional[Sequence[_vpc.SecgroupRuleArgs]] = None,
        updated_at: Optional[str] = None) -> Secgroup
func GetSecgroup(ctx *Context, name string, id IDInput, state *SecgroupState, opts ...ResourceOption) (*Secgroup, error)
public static Secgroup Get(string name, Input<string> id, SecgroupState? state, CustomResourceOptions? opts = null)
public static Secgroup get(String name, Output<String> id, SecgroupState 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:
CreatedAt string

The creation time, in UTC format.

DeleteDefaultRules bool

Specifies whether or not to delete the default security rules. This is false by default.

Description string

Specifies the description for the security group.

EnterpriseProjectId string

Specifies the enterprise project id of the security group. Changing this creates a new security group.

Name string

Specifies a unique name for the security group.

Region string

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

Rules List<SecgroupRuleArgs>

The array of security group rules associating with the security group. The rule object is documented below.

UpdatedAt string

The last update time, in UTC format.

CreatedAt string

The creation time, in UTC format.

DeleteDefaultRules bool

Specifies whether or not to delete the default security rules. This is false by default.

Description string

Specifies the description for the security group.

EnterpriseProjectId string

Specifies the enterprise project id of the security group. Changing this creates a new security group.

Name string

Specifies a unique name for the security group.

Region string

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

Rules []SecgroupRuleTypeArgs

The array of security group rules associating with the security group. The rule object is documented below.

UpdatedAt string

The last update time, in UTC format.

createdAt String

The creation time, in UTC format.

deleteDefaultRules Boolean

Specifies whether or not to delete the default security rules. This is false by default.

description String

Specifies the description for the security group.

enterpriseProjectId String

Specifies the enterprise project id of the security group. Changing this creates a new security group.

name String

Specifies a unique name for the security group.

region String

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

rules List<SecgroupRuleArgs>

The array of security group rules associating with the security group. The rule object is documented below.

updatedAt String

The last update time, in UTC format.

createdAt string

The creation time, in UTC format.

deleteDefaultRules boolean

Specifies whether or not to delete the default security rules. This is false by default.

description string

Specifies the description for the security group.

enterpriseProjectId string

Specifies the enterprise project id of the security group. Changing this creates a new security group.

name string

Specifies a unique name for the security group.

region string

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

rules SecgroupRuleArgs[]

The array of security group rules associating with the security group. The rule object is documented below.

updatedAt string

The last update time, in UTC format.

created_at str

The creation time, in UTC format.

delete_default_rules bool

Specifies whether or not to delete the default security rules. This is false by default.

description str

Specifies the description for the security group.

enterprise_project_id str

Specifies the enterprise project id of the security group. Changing this creates a new security group.

name str

Specifies a unique name for the security group.

region str

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

rules SecgroupRuleArgs]

The array of security group rules associating with the security group. The rule object is documented below.

updated_at str

The last update time, in UTC format.

createdAt String

The creation time, in UTC format.

deleteDefaultRules Boolean

Specifies whether or not to delete the default security rules. This is false by default.

description String

Specifies the description for the security group.

enterpriseProjectId String

Specifies the enterprise project id of the security group. Changing this creates a new security group.

name String

Specifies a unique name for the security group.

region String

The region in which to create the security group resource. If omitted, the provider-level region will be used. Changing this creates a new security group resource.

rules List<Property Map>

The array of security group rules associating with the security group. The rule object is documented below.

updatedAt String

The last update time, in UTC format.

Supporting Types

SecgroupRule

Action string

The effective policy.

Description string

Specifies the description for the security group.

Direction string

The direction of the rule. The value can be egress or ingress.

Ethertype string

The IP protocol version. The value can be IPv4 or IPv6.

Id string

The security group rule ID.

PortRangeMax int
PortRangeMin int
Ports string

The port value range.

Priority int

The priority number.

Protocol string

The protocol type.

RemoteAddressGroupId string

The ID of the remote address group.

RemoteGroupId string

The ID of the peer security group.

RemoteIpPrefix string

The remote IP address. The value can be in the CIDR format or IP addresses.

Action string

The effective policy.

Description string

Specifies the description for the security group.

Direction string

The direction of the rule. The value can be egress or ingress.

Ethertype string

The IP protocol version. The value can be IPv4 or IPv6.

Id string

The security group rule ID.

PortRangeMax int
PortRangeMin int
Ports string

The port value range.

Priority int

The priority number.

Protocol string

The protocol type.

RemoteAddressGroupId string

The ID of the remote address group.

RemoteGroupId string

The ID of the peer security group.

RemoteIpPrefix string

The remote IP address. The value can be in the CIDR format or IP addresses.

action String

The effective policy.

description String

Specifies the description for the security group.

direction String

The direction of the rule. The value can be egress or ingress.

ethertype String

The IP protocol version. The value can be IPv4 or IPv6.

id String

The security group rule ID.

portRangeMax Integer
portRangeMin Integer
ports String

The port value range.

priority Integer

The priority number.

protocol String

The protocol type.

remoteAddressGroupId String

The ID of the remote address group.

remoteGroupId String

The ID of the peer security group.

remoteIpPrefix String

The remote IP address. The value can be in the CIDR format or IP addresses.

action string

The effective policy.

description string

Specifies the description for the security group.

direction string

The direction of the rule. The value can be egress or ingress.

ethertype string

The IP protocol version. The value can be IPv4 or IPv6.

id string

The security group rule ID.

portRangeMax number
portRangeMin number
ports string

The port value range.

priority number

The priority number.

protocol string

The protocol type.

remoteAddressGroupId string

The ID of the remote address group.

remoteGroupId string

The ID of the peer security group.

remoteIpPrefix string

The remote IP address. The value can be in the CIDR format or IP addresses.

action str

The effective policy.

description str

Specifies the description for the security group.

direction str

The direction of the rule. The value can be egress or ingress.

ethertype str

The IP protocol version. The value can be IPv4 or IPv6.

id str

The security group rule ID.

port_range_max int
port_range_min int
ports str

The port value range.

priority int

The priority number.

protocol str

The protocol type.

remote_address_group_id str

The ID of the remote address group.

remote_group_id str

The ID of the peer security group.

remote_ip_prefix str

The remote IP address. The value can be in the CIDR format or IP addresses.

action String

The effective policy.

description String

Specifies the description for the security group.

direction String

The direction of the rule. The value can be egress or ingress.

ethertype String

The IP protocol version. The value can be IPv4 or IPv6.

id String

The security group rule ID.

portRangeMax Number
portRangeMin Number
ports String

The port value range.

priority Number

The priority number.

protocol String

The protocol type.

remoteAddressGroupId String

The ID of the remote address group.

remoteGroupId String

The ID of the peer security group.

remoteIpPrefix String

The remote IP address. The value can be in the CIDR format or IP addresses.

Package Details

Repository
https://github.com/huaweicloud/pulumi-huaweicloud
License
Apache-2.0
Notes

This Pulumi package is based on the huaweicloud Terraform Provider.