Alibaba Cloud

v3.15.0 published on Thursday, Jan 13, 2022 by Pulumi

SecurityPolicy

Provides a ALB Security Policy resource.

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

NOTE: Available in v1.130.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "testAccSecurityPolicy";
        var @default = new AliCloud.Alb.SecurityPolicy("default", new AliCloud.Alb.SecurityPolicyArgs
        {
            SecurityPolicyName = name,
            TlsVersions = 
            {
                "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"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "testAccSecurityPolicy"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_, err := alb.NewSecurityPolicy(ctx, "_default", &alb.SecurityPolicyArgs{
			SecurityPolicyName: pulumi.String(name),
			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
	})
}
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "testAccSecurityPolicy"
default = alicloud.alb.SecurityPolicy("default",
    security_policy_name=name,
    tls_versions=["TLSv1.0"],
    ciphers=[
        "ECDHE-ECDSA-AES128-SHA",
        "AES256-SHA",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "testAccSecurityPolicy";
const _default = new alicloud.alb.SecurityPolicy("default", {
    securityPolicyName: name,
    tlsVersions: ["TLSv1.0"],
    ciphers: [
        "ECDHE-ECDSA-AES128-SHA",
        "AES256-SHA",
    ],
});

Create a SecurityPolicy Resource

new SecurityPolicy(name: string, args: SecurityPolicyArgs, opts?: CustomResourceOptions);
@overload
def SecurityPolicy(resource_name: 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,
                   tags: Optional[Mapping[str, Any]] = None,
                   tls_versions: Optional[Sequence[str]] = None)
@overload
def SecurityPolicy(resource_name: str,
                   args: SecurityPolicyArgs,
                   opts: Optional[ResourceOptions] = None)
func NewSecurityPolicy(ctx *Context, name string, args SecurityPolicyArgs, opts ...ResourceOption) (*SecurityPolicy, error)
public SecurityPolicy(string name, SecurityPolicyArgs args, CustomResourceOptions? opts = null)
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.

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>
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{}
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}
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]

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 str
The provider-assigned unique ID for this managed resource.
status str
The status of the resource.

Look up an 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)
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.

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>
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{}
TlsVersions []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}
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]
tls_versions Sequence[str]
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>

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.