1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. alb
  5. SecurityPolicy
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.alb.SecurityPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a ALB Security Policy resource.

    For information about ALB Security Policy and how to use it, see What is Security Policy.

    NOTE: Available since v1.130.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.alb.SecurityPolicy("default", {
        securityPolicyName: "tf_example",
        tlsVersions: ["TLSv1.0"],
        ciphers: [
            "ECDHE-ECDSA-AES128-SHA",
            "AES256-SHA",
        ],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.alb.SecurityPolicy("default",
        security_policy_name="tf_example",
        tls_versions=["TLSv1.0"],
        ciphers=[
            "ECDHE-ECDSA-AES128-SHA",
            "AES256-SHA",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/alb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := alb.NewSecurityPolicy(ctx, "default", &alb.SecurityPolicyArgs{
    			SecurityPolicyName: pulumi.String("tf_example"),
    			TlsVersions: pulumi.StringArray{
    				pulumi.String("TLSv1.0"),
    			},
    			Ciphers: pulumi.StringArray{
    				pulumi.String("ECDHE-ECDSA-AES128-SHA"),
    				pulumi.String("AES256-SHA"),
    			},
    		})
    		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 @default = new AliCloud.Alb.SecurityPolicy("default", new()
        {
            SecurityPolicyName = "tf_example",
            TlsVersions = new[]
            {
                "TLSv1.0",
            },
            Ciphers = new[]
            {
                "ECDHE-ECDSA-AES128-SHA",
                "AES256-SHA",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.alb.SecurityPolicy;
    import com.pulumi.alicloud.alb.SecurityPolicyArgs;
    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 SecurityPolicy("default", SecurityPolicyArgs.builder()
                .securityPolicyName("tf_example")
                .tlsVersions("TLSv1.0")
                .ciphers(            
                    "ECDHE-ECDSA-AES128-SHA",
                    "AES256-SHA")
                .build());
    
        }
    }
    
    resources:
      default:
        type: alicloud:alb:SecurityPolicy
        properties:
          securityPolicyName: tf_example
          tlsVersions:
            - TLSv1.0
          ciphers:
            - ECDHE-ECDSA-AES128-SHA
            - AES256-SHA
    

    Create SecurityPolicy Resource

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

    Constructor syntax

    new SecurityPolicy(name: string, args: SecurityPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def SecurityPolicy(resource_name: str,
                       args: SecurityPolicyArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecurityPolicy(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       ciphers: Optional[Sequence[str]] = None,
                       security_policy_name: Optional[str] = None,
                       tls_versions: Optional[Sequence[str]] = None,
                       dry_run: Optional[bool] = None,
                       resource_group_id: Optional[str] = None,
                       tags: Optional[Mapping[str, Any]] = None)
    func NewSecurityPolicy(ctx *Context, name string, args SecurityPolicyArgs, opts ...ResourceOption) (*SecurityPolicy, error)
    public SecurityPolicy(string name, SecurityPolicyArgs args, CustomResourceOptions? opts = null)
    public SecurityPolicy(String name, SecurityPolicyArgs args)
    public SecurityPolicy(String name, SecurityPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:alb:SecurityPolicy
    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 SecurityPolicyArgs
    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 SecurityPolicyArgs
    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 SecurityPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecurityPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecurityPolicyArgs
    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 securityPolicyResource = new AliCloud.Alb.SecurityPolicy("securityPolicyResource", new()
    {
        Ciphers = new[]
        {
            "string",
        },
        SecurityPolicyName = "string",
        TlsVersions = new[]
        {
            "string",
        },
        DryRun = false,
        ResourceGroupId = "string",
        Tags = 
        {
            { "string", "any" },
        },
    });
    
    example, err := alb.NewSecurityPolicy(ctx, "securityPolicyResource", &alb.SecurityPolicyArgs{
    	Ciphers: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SecurityPolicyName: pulumi.String("string"),
    	TlsVersions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	DryRun:          pulumi.Bool(false),
    	ResourceGroupId: pulumi.String("string"),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var securityPolicyResource = new SecurityPolicy("securityPolicyResource", SecurityPolicyArgs.builder()
        .ciphers("string")
        .securityPolicyName("string")
        .tlsVersions("string")
        .dryRun(false)
        .resourceGroupId("string")
        .tags(Map.of("string", "any"))
        .build());
    
    security_policy_resource = alicloud.alb.SecurityPolicy("securityPolicyResource",
        ciphers=["string"],
        security_policy_name="string",
        tls_versions=["string"],
        dry_run=False,
        resource_group_id="string",
        tags={
            "string": "any",
        })
    
    const securityPolicyResource = new alicloud.alb.SecurityPolicy("securityPolicyResource", {
        ciphers: ["string"],
        securityPolicyName: "string",
        tlsVersions: ["string"],
        dryRun: false,
        resourceGroupId: "string",
        tags: {
            string: "any",
        },
    });
    
    type: alicloud:alb:SecurityPolicy
    properties:
        ciphers:
            - string
        dryRun: false
        resourceGroupId: string
        securityPolicyName: string
        tags:
            string: any
        tlsVersions:
            - string
    

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

    Ciphers List<string>
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    SecurityPolicyName string
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    TlsVersions List<string>
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    DryRun bool
    The dry run.
    ResourceGroupId string
    The ID of the resource group.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    Ciphers []string
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    SecurityPolicyName string
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    TlsVersions []string
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    DryRun bool
    The dry run.
    ResourceGroupId string
    The ID of the resource group.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    ciphers List<String>
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    securityPolicyName String
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    tlsVersions List<String>
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    dryRun Boolean
    The dry run.
    resourceGroupId String
    The ID of the resource group.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    ciphers string[]
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    securityPolicyName string
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    tlsVersions string[]
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    dryRun boolean
    The dry run.
    resourceGroupId string
    The ID of the resource group.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    ciphers Sequence[str]
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    security_policy_name str
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    tls_versions Sequence[str]
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    dry_run bool
    The dry run.
    resource_group_id str
    The ID of the resource group.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    ciphers List<String>
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    securityPolicyName String
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    tlsVersions List<String>
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    dryRun Boolean
    The dry run.
    resourceGroupId String
    The ID of the resource group.
    tags Map<Any>
    A mapping of tags to assign to the resource.

    Outputs

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

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

    Look up Existing SecurityPolicy Resource

    Get an existing SecurityPolicy 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?: SecurityPolicyState, opts?: CustomResourceOptions): SecurityPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ciphers: Optional[Sequence[str]] = None,
            dry_run: Optional[bool] = None,
            resource_group_id: Optional[str] = None,
            security_policy_name: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None,
            tls_versions: Optional[Sequence[str]] = None) -> SecurityPolicy
    func GetSecurityPolicy(ctx *Context, name string, id IDInput, state *SecurityPolicyState, opts ...ResourceOption) (*SecurityPolicy, error)
    public static SecurityPolicy Get(string name, Input<string> id, SecurityPolicyState? state, CustomResourceOptions? opts = null)
    public static SecurityPolicy get(String name, Output<String> id, SecurityPolicyState 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:
    Ciphers List<string>
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    DryRun bool
    The dry run.
    ResourceGroupId string
    The ID of the resource group.
    SecurityPolicyName string
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    Status string
    The status of the resource.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    TlsVersions List<string>
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    Ciphers []string
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    DryRun bool
    The dry run.
    ResourceGroupId string
    The ID of the resource group.
    SecurityPolicyName string
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    Status string
    The status of the resource.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    TlsVersions []string
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    ciphers List<String>
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    dryRun Boolean
    The dry run.
    resourceGroupId String
    The ID of the resource group.
    securityPolicyName String
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    status String
    The status of the resource.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    tlsVersions List<String>
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    ciphers string[]
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    dryRun boolean
    The dry run.
    resourceGroupId string
    The ID of the resource group.
    securityPolicyName string
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    status string
    The status of the resource.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    tlsVersions string[]
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    ciphers Sequence[str]
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    dry_run bool
    The dry run.
    resource_group_id str
    The ID of the resource group.
    security_policy_name str
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    status str
    The status of the resource.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    tls_versions Sequence[str]
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
    ciphers List<String>
    The supported cipher suites, which are determined by the TLS protocol version.The specified cipher suites must be supported by at least one TLS protocol version that you select.
    dryRun Boolean
    The dry run.
    resourceGroupId String
    The ID of the resource group.
    securityPolicyName String
    The name of the resource. The name must be 2 to 128 characters in length and must start with a letter. It can contain digits, periods (.), underscores (_), and hyphens (-).
    status String
    The status of the resource.
    tags Map<Any>
    A mapping of tags to assign to the resource.
    tlsVersions List<String>
    The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.

    Import

    ALB Security Policy can be imported using the id, e.g.

    $ pulumi import alicloud:alb/securityPolicy:SecurityPolicy 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.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi