com.pulumi.alicloud.ecs.kotlin.SecurityGroupArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-alicloud-kotlin Show documentation
Show all versions of pulumi-alicloud-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.alicloud.ecs.kotlin
import com.pulumi.alicloud.ecs.SecurityGroupArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Provides a Security Group resource.
* For information about Security Group and how to use it, see [What is Security Group](https://www.alibabacloud.com/help/en/ecs/developer-reference/api-createsecuritygroup).
* > **NOTE:** Available since v1.0.0.
* > **NOTE:** `alicloud.ecs.SecurityGroup` is used to build and manage a security group, and `alicloud.ecs.SecurityGroupRule` can define ingress or egress rules for it.
* > **NOTE:** From version 1.7.2, `alicloud.ecs.SecurityGroup` has supported to segregate different ECS instance in which the same security group.
* ## Example Usage
* Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as alicloud from "@pulumi/alicloud";
* const _default = new alicloud.ecs.SecurityGroup("default", {
* name: "terraform-example",
* description: "New security group",
* });
* ```
* ```python
* import pulumi
* import pulumi_alicloud as alicloud
* default = alicloud.ecs.SecurityGroup("default",
* name="terraform-example",
* description="New security group")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AliCloud = Pulumi.AliCloud;
* return await Deployment.RunAsync(() =>
* {
* var @default = new AliCloud.Ecs.SecurityGroup("default", new()
* {
* Name = "terraform-example",
* Description = "New security group",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
* Name: pulumi.String("terraform-example"),
* Description: pulumi.String("New security group"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.alicloud.ecs.SecurityGroup;
* import com.pulumi.alicloud.ecs.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 default_ = new SecurityGroup("default", SecurityGroupArgs.builder()
* .name("terraform-example")
* .description("New security group")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: alicloud:ecs:SecurityGroup
* properties:
* name: terraform-example
* description: New security group
* ```
*
* Basic Usage for VPC
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as alicloud from "@pulumi/alicloud";
* const vpc = new alicloud.vpc.Network("vpc", {
* vpcName: "terraform-example",
* cidrBlock: "10.1.0.0/21",
* });
* const group = new alicloud.ecs.SecurityGroup("group", {
* name: "terraform-example",
* vpcId: vpc.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_alicloud as alicloud
* vpc = alicloud.vpc.Network("vpc",
* vpc_name="terraform-example",
* cidr_block="10.1.0.0/21")
* group = alicloud.ecs.SecurityGroup("group",
* name="terraform-example",
* vpc_id=vpc.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AliCloud = Pulumi.AliCloud;
* return await Deployment.RunAsync(() =>
* {
* var vpc = new AliCloud.Vpc.Network("vpc", new()
* {
* VpcName = "terraform-example",
* CidrBlock = "10.1.0.0/21",
* });
* var @group = new AliCloud.Ecs.SecurityGroup("group", new()
* {
* Name = "terraform-example",
* VpcId = vpc.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
* VpcName: pulumi.String("terraform-example"),
* CidrBlock: pulumi.String("10.1.0.0/21"),
* })
* if err != nil {
* return err
* }
* _, err = ecs.NewSecurityGroup(ctx, "group", &ecs.SecurityGroupArgs{
* Name: pulumi.String("terraform-example"),
* VpcId: vpc.ID(),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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.ecs.SecurityGroup;
* import com.pulumi.alicloud.ecs.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 vpc = new Network("vpc", NetworkArgs.builder()
* .vpcName("terraform-example")
* .cidrBlock("10.1.0.0/21")
* .build());
* var group = new SecurityGroup("group", SecurityGroupArgs.builder()
* .name("terraform-example")
* .vpcId(vpc.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* vpc:
* type: alicloud:vpc:Network
* properties:
* vpcName: terraform-example
* cidrBlock: 10.1.0.0/21
* group:
* type: alicloud:ecs:SecurityGroup
* properties:
* name: terraform-example
* vpcId: ${vpc.id}
* ```
*
* ## Module Support
* You can use the existing security-group module
* to create a security group and add several rules one-click.
* ## Import
* Security Group can be imported using the id, e.g.
* ```sh
* $ pulumi import alicloud:ecs/securityGroup:SecurityGroup example sg-abc123456
* ```
* @property description The security group description. Defaults to null.
* @property innerAccess Field `inner_access` has been deprecated from provider version 1.55.3. New field `inner_access_policy` instead.
* Combining security group rules, the policy can define multiple application scenario. Default to true. It is valid from version `1.7.2`.
* @property innerAccessPolicy The internal access control policy of the security group. Valid values: `Accept`, `Drop`.
* @property name The name of the security group. Defaults to null.
* @property resourceGroupId The ID of the resource group to which the security group belongs. **NOTE:** From version 1.115.0, `resource_group_id` can be modified.
* @property securityGroupType The type of the security group. Valid values:
* @property tags A mapping of tags to assign to the resource.
* @property vpcId The ID of the VPC.
*/
public data class SecurityGroupArgs(
public val description: Output? = null,
@Deprecated(
message = """
Field `inner_access` has been deprecated from provider version 1.55.3. Use `inner_access_policy`
replaces it.
""",
)
public val innerAccess: Output? = null,
public val innerAccessPolicy: Output? = null,
public val name: Output? = null,
public val resourceGroupId: Output? = null,
public val securityGroupType: Output? = null,
public val tags: Output