Alibaba Cloud

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

getSecurityPolicies

This data source provides the Alb Security Policies of the current Alibaba Cloud user.

NOTE: Available in v1.130.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.Alb.GetSecurityPolicies.InvokeAsync());
        this.AlbSecurityPolicyId1 = ids.Apply(ids => ids.Policies?[0]?.Id);
        var nameRegex = Output.Create(AliCloud.Alb.GetSecurityPolicies.InvokeAsync(new AliCloud.Alb.GetSecurityPoliciesArgs
        {
            NameRegex = "^my-SecurityPolicy",
        }));
        this.AlbSecurityPolicyId2 = nameRegex.Apply(nameRegex => nameRegex.Policies?[0]?.Id);
    }

    [Output("albSecurityPolicyId1")]
    public Output<string> AlbSecurityPolicyId1 { get; set; }
    [Output("albSecurityPolicyId2")]
    public Output<string> AlbSecurityPolicyId2 { get; set; }
}
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 {
		ids, err := alb.GetSecurityPolicies(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("albSecurityPolicyId1", ids.Policies[0].Id)
		opt0 := "^my-SecurityPolicy"
		nameRegex, err := alb.GetSecurityPolicies(ctx, &alb.GetSecurityPoliciesArgs{
			NameRegex: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("albSecurityPolicyId2", nameRegex.Policies[0].Id)
		return nil
	})
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.alb.get_security_policies()
pulumi.export("albSecurityPolicyId1", ids.policies[0].id)
name_regex = alicloud.alb.get_security_policies(name_regex="^my-SecurityPolicy")
pulumi.export("albSecurityPolicyId2", name_regex.policies[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.alb.getSecurityPolicies({});
export const albSecurityPolicyId1 = ids.then(ids => ids.policies?[0]?.id);
const nameRegex = alicloud.alb.getSecurityPolicies({
    nameRegex: "^my-SecurityPolicy",
});
export const albSecurityPolicyId2 = nameRegex.then(nameRegex => nameRegex.policies?[0]?.id);

Using getSecurityPolicies

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSecurityPolicies(args: GetSecurityPoliciesArgs, opts?: InvokeOptions): Promise<GetSecurityPoliciesResult>
function getSecurityPoliciesOutput(args: GetSecurityPoliciesOutputArgs, opts?: InvokeOptions): Output<GetSecurityPoliciesResult>
def get_security_policies(ids: Optional[Sequence[str]] = None,
                          name_regex: Optional[str] = None,
                          output_file: Optional[str] = None,
                          resource_group_id: Optional[str] = None,
                          security_policy_ids: Optional[Sequence[str]] = None,
                          security_policy_name: Optional[str] = None,
                          status: Optional[str] = None,
                          tags: Optional[Mapping[str, Any]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetSecurityPoliciesResult
def get_security_policies_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          name_regex: Optional[pulumi.Input[str]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          resource_group_id: Optional[pulumi.Input[str]] = None,
                          security_policy_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          security_policy_name: Optional[pulumi.Input[str]] = None,
                          status: Optional[pulumi.Input[str]] = None,
                          tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetSecurityPoliciesResult]
func GetSecurityPolicies(ctx *Context, args *GetSecurityPoliciesArgs, opts ...InvokeOption) (*GetSecurityPoliciesResult, error)
func GetSecurityPoliciesOutput(ctx *Context, args *GetSecurityPoliciesOutputArgs, opts ...InvokeOption) GetSecurityPoliciesResultOutput

> Note: This function is named GetSecurityPolicies in the Go SDK.

public static class GetSecurityPolicies 
{
    public static Task<GetSecurityPoliciesResult> InvokeAsync(GetSecurityPoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetSecurityPoliciesResult> Invoke(GetSecurityPoliciesInvokeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Ids List<string>
A list of Security Policy IDs.
NameRegex string
A regex string to filter results by Security Policy name.
OutputFile string
ResourceGroupId string
The ID of the resource group.
SecurityPolicyIds List<string>
The security policy ids.
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>
Ids []string
A list of Security Policy IDs.
NameRegex string
A regex string to filter results by Security Policy name.
OutputFile string
ResourceGroupId string
The ID of the resource group.
SecurityPolicyIds []string
The security policy ids.
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{}
ids string[]
A list of Security Policy IDs.
nameRegex string
A regex string to filter results by Security Policy name.
outputFile string
resourceGroupId string
The ID of the resource group.
securityPolicyIds string[]
The security policy ids.
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}
ids Sequence[str]
A list of Security Policy IDs.
name_regex str
A regex string to filter results by Security Policy name.
output_file str
resource_group_id str
The ID of the resource group.
security_policy_ids Sequence[str]
The security policy ids.
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]

getSecurityPolicies Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
Policies List<Pulumi.AliCloud.Alb.Outputs.GetSecurityPoliciesPolicy>
NameRegex string
OutputFile string
ResourceGroupId string
SecurityPolicyIds List<string>
SecurityPolicyName string
Status string
Tags Dictionary<string, object>
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
Policies []GetSecurityPoliciesPolicy
NameRegex string
OutputFile string
ResourceGroupId string
SecurityPolicyIds []string
SecurityPolicyName string
Status string
Tags map[string]interface{}
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
policies GetSecurityPoliciesPolicy[]
nameRegex string
outputFile string
resourceGroupId string
securityPolicyIds string[]
securityPolicyName string
status string
tags {[key: string]: any}
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
policies Sequence[GetSecurityPoliciesPolicy]
name_regex str
output_file str
resource_group_id str
security_policy_ids Sequence[str]
security_policy_name str
status str
tags Mapping[str, Any]

Supporting Types

GetSecurityPoliciesPolicy

Ciphers List<string>
The supported cipher suites, which are determined by the TLS protocol version.
Id string
The ID of the Security Policy.
ResourceGroupId string
The ID of the resource group.
SecurityPolicyId string
The first ID of the resource.
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.
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.
Id string
The ID of the Security Policy.
ResourceGroupId string
The ID of the resource group.
SecurityPolicyId string
The first ID of the resource.
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.
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.
id string
The ID of the Security Policy.
resourceGroupId string
The ID of the resource group.
securityPolicyId string
The first ID of the resource.
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.
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.
id str
The ID of the Security Policy.
resource_group_id str
The ID of the resource group.
security_policy_id str
The first ID of the resource.
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.
tls_versions Sequence[str]
The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.

Package Details

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