1. Packages
  2. Volcengine
  3. API Docs
  4. vpc
  5. SecurityGroup
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.vpc.SecurityGroup

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

    Provides a resource to manage security group

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var g1test1 = new Volcengine.Vpc.SecurityGroup("g1test1", new()
        {
            ProjectName = "default",
            VpcId = "vpc-2feppmy1ugt1c59gp688n1fld",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vpc.NewSecurityGroup(ctx, "g1test1", &vpc.SecurityGroupArgs{
    			ProjectName: pulumi.String("default"),
    			VpcId:       pulumi.String("vpc-2feppmy1ugt1c59gp688n1fld"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.vpc.SecurityGroup;
    import com.pulumi.volcengine.vpc.SecurityGroupArgs;
    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) {
            var g1test1 = new SecurityGroup("g1test1", SecurityGroupArgs.builder()        
                .projectName("default")
                .vpcId("vpc-2feppmy1ugt1c59gp688n1fld")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    g1test1 = volcengine.vpc.SecurityGroup("g1test1",
        project_name="default",
        vpc_id="vpc-2feppmy1ugt1c59gp688n1fld")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const g1test1 = new volcengine.vpc.SecurityGroup("g1test1", {
        projectName: "default",
        vpcId: "vpc-2feppmy1ugt1c59gp688n1fld",
    });
    
    resources:
      g1test1:
        type: volcengine:vpc:SecurityGroup
        properties:
          projectName: default
          vpcId: vpc-2feppmy1ugt1c59gp688n1fld
    

    Create SecurityGroup Resource

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

    Constructor syntax

    new SecurityGroup(name: string, args: SecurityGroupArgs, opts?: CustomResourceOptions);
    @overload
    def SecurityGroup(resource_name: str,
                      args: SecurityGroupArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecurityGroup(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      vpc_id: Optional[str] = None,
                      description: Optional[str] = None,
                      project_name: Optional[str] = None,
                      security_group_name: Optional[str] = None,
                      tags: Optional[Sequence[SecurityGroupTagArgs]] = None)
    func NewSecurityGroup(ctx *Context, name string, args SecurityGroupArgs, opts ...ResourceOption) (*SecurityGroup, error)
    public SecurityGroup(string name, SecurityGroupArgs args, CustomResourceOptions? opts = null)
    public SecurityGroup(String name, SecurityGroupArgs args)
    public SecurityGroup(String name, SecurityGroupArgs args, CustomResourceOptions options)
    
    type: volcengine:vpc:SecurityGroup
    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 SecurityGroupArgs
    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 SecurityGroupArgs
    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 SecurityGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecurityGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecurityGroupArgs
    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 volcengineSecurityGroupResource = new Volcengine.Vpc.SecurityGroup("volcengineSecurityGroupResource", new()
    {
        VpcId = "string",
        Description = "string",
        ProjectName = "string",
        SecurityGroupName = "string",
        Tags = new[]
        {
            new Volcengine.Vpc.Inputs.SecurityGroupTagArgs
            {
                Key = "string",
                Value = "string",
            },
        },
    });
    
    example, err := vpc.NewSecurityGroup(ctx, "volcengineSecurityGroupResource", &vpc.SecurityGroupArgs{
    	VpcId:             pulumi.String("string"),
    	Description:       pulumi.String("string"),
    	ProjectName:       pulumi.String("string"),
    	SecurityGroupName: pulumi.String("string"),
    	Tags: vpc.SecurityGroupTagArray{
    		&vpc.SecurityGroupTagArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    })
    
    var volcengineSecurityGroupResource = new SecurityGroup("volcengineSecurityGroupResource", SecurityGroupArgs.builder()
        .vpcId("string")
        .description("string")
        .projectName("string")
        .securityGroupName("string")
        .tags(SecurityGroupTagArgs.builder()
            .key("string")
            .value("string")
            .build())
        .build());
    
    volcengine_security_group_resource = volcengine.vpc.SecurityGroup("volcengineSecurityGroupResource",
        vpc_id="string",
        description="string",
        project_name="string",
        security_group_name="string",
        tags=[volcengine.vpc.SecurityGroupTagArgs(
            key="string",
            value="string",
        )])
    
    const volcengineSecurityGroupResource = new volcengine.vpc.SecurityGroup("volcengineSecurityGroupResource", {
        vpcId: "string",
        description: "string",
        projectName: "string",
        securityGroupName: "string",
        tags: [{
            key: "string",
            value: "string",
        }],
    });
    
    type: volcengine:vpc:SecurityGroup
    properties:
        description: string
        projectName: string
        securityGroupName: string
        tags:
            - key: string
              value: string
        vpcId: string
    

    SecurityGroup 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 SecurityGroup resource accepts the following input properties:

    VpcId string
    Id of the VPC.
    Description string
    Description of SecurityGroup.
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupName string
    Name of SecurityGroup.
    Tags List<SecurityGroupTag>
    Tags.
    VpcId string
    Id of the VPC.
    Description string
    Description of SecurityGroup.
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupName string
    Name of SecurityGroup.
    Tags []SecurityGroupTagArgs
    Tags.
    vpcId String
    Id of the VPC.
    description String
    Description of SecurityGroup.
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupName String
    Name of SecurityGroup.
    tags List<SecurityGroupTag>
    Tags.
    vpcId string
    Id of the VPC.
    description string
    Description of SecurityGroup.
    projectName string
    The ProjectName of SecurityGroup.
    securityGroupName string
    Name of SecurityGroup.
    tags SecurityGroupTag[]
    Tags.
    vpc_id str
    Id of the VPC.
    description str
    Description of SecurityGroup.
    project_name str
    The ProjectName of SecurityGroup.
    security_group_name str
    Name of SecurityGroup.
    tags Sequence[SecurityGroupTagArgs]
    Tags.
    vpcId String
    Id of the VPC.
    description String
    Description of SecurityGroup.
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupName String
    Name of SecurityGroup.
    tags List<Property Map>
    Tags.

    Outputs

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

    CreationTime string
    Creation time of SecurityGroup.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Status of SecurityGroup.
    CreationTime string
    Creation time of SecurityGroup.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Status of SecurityGroup.
    creationTime String
    Creation time of SecurityGroup.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Status of SecurityGroup.
    creationTime string
    Creation time of SecurityGroup.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Status of SecurityGroup.
    creation_time str
    Creation time of SecurityGroup.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    Status of SecurityGroup.
    creationTime String
    Creation time of SecurityGroup.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Status of SecurityGroup.

    Look up Existing SecurityGroup Resource

    Get an existing SecurityGroup 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?: SecurityGroupState, opts?: CustomResourceOptions): SecurityGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            creation_time: Optional[str] = None,
            description: Optional[str] = None,
            project_name: Optional[str] = None,
            security_group_name: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[SecurityGroupTagArgs]] = None,
            vpc_id: Optional[str] = None) -> SecurityGroup
    func GetSecurityGroup(ctx *Context, name string, id IDInput, state *SecurityGroupState, opts ...ResourceOption) (*SecurityGroup, error)
    public static SecurityGroup Get(string name, Input<string> id, SecurityGroupState? state, CustomResourceOptions? opts = null)
    public static SecurityGroup get(String name, Output<String> id, SecurityGroupState 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:
    CreationTime string
    Creation time of SecurityGroup.
    Description string
    Description of SecurityGroup.
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupName string
    Name of SecurityGroup.
    Status string
    Status of SecurityGroup.
    Tags List<SecurityGroupTag>
    Tags.
    VpcId string
    Id of the VPC.
    CreationTime string
    Creation time of SecurityGroup.
    Description string
    Description of SecurityGroup.
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupName string
    Name of SecurityGroup.
    Status string
    Status of SecurityGroup.
    Tags []SecurityGroupTagArgs
    Tags.
    VpcId string
    Id of the VPC.
    creationTime String
    Creation time of SecurityGroup.
    description String
    Description of SecurityGroup.
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupName String
    Name of SecurityGroup.
    status String
    Status of SecurityGroup.
    tags List<SecurityGroupTag>
    Tags.
    vpcId String
    Id of the VPC.
    creationTime string
    Creation time of SecurityGroup.
    description string
    Description of SecurityGroup.
    projectName string
    The ProjectName of SecurityGroup.
    securityGroupName string
    Name of SecurityGroup.
    status string
    Status of SecurityGroup.
    tags SecurityGroupTag[]
    Tags.
    vpcId string
    Id of the VPC.
    creation_time str
    Creation time of SecurityGroup.
    description str
    Description of SecurityGroup.
    project_name str
    The ProjectName of SecurityGroup.
    security_group_name str
    Name of SecurityGroup.
    status str
    Status of SecurityGroup.
    tags Sequence[SecurityGroupTagArgs]
    Tags.
    vpc_id str
    Id of the VPC.
    creationTime String
    Creation time of SecurityGroup.
    description String
    Description of SecurityGroup.
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupName String
    Name of SecurityGroup.
    status String
    Status of SecurityGroup.
    tags List<Property Map>
    Tags.
    vpcId String
    Id of the VPC.

    Supporting Types

    SecurityGroupTag, SecurityGroupTagArgs

    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.
    key string
    The Key of Tags.
    value string
    The Value of Tags.
    key str
    The Key of Tags.
    value str
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.

    Import

    SecurityGroup can be imported using the id, e.g.

     $ pulumi import volcengine:vpc/securityGroup:SecurityGroup default sg-273ycgql3ig3k7fap8t3dyvqx
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine