Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.alb.getSecurityPolicies
Explore with Pulumi AI
This data source provides the Alb Security Policies of the current Alibaba Cloud user.
NOTE: Available in v1.130.0+.
Example Usage
Basic Usage
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);
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)
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, &alb.GetSecurityPoliciesArgs{}, nil)
if err != nil {
return err
}
ctx.Export("albSecurityPolicyId1", ids.Policies[0].Id)
nameRegex, err := alb.GetSecurityPolicies(ctx, &alb.GetSecurityPoliciesArgs{
NameRegex: pulumi.StringRef("^my-SecurityPolicy"),
}, nil)
if err != nil {
return err
}
ctx.Export("albSecurityPolicyId2", nameRegex.Policies[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Alb.GetSecurityPolicies.Invoke();
var nameRegex = AliCloud.Alb.GetSecurityPolicies.Invoke(new()
{
NameRegex = "^my-SecurityPolicy",
});
return new Dictionary<string, object?>
{
["albSecurityPolicyId1"] = ids.Apply(getSecurityPoliciesResult => getSecurityPoliciesResult.Policies[0]?.Id),
["albSecurityPolicyId2"] = nameRegex.Apply(getSecurityPoliciesResult => getSecurityPoliciesResult.Policies[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.alb.AlbFunctions;
import com.pulumi.alicloud.alb.inputs.GetSecurityPoliciesArgs;
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) {
final var ids = AlbFunctions.getSecurityPolicies();
ctx.export("albSecurityPolicyId1", ids.applyValue(getSecurityPoliciesResult -> getSecurityPoliciesResult.policies()[0].id()));
final var nameRegex = AlbFunctions.getSecurityPolicies(GetSecurityPoliciesArgs.builder()
.nameRegex("^my-SecurityPolicy")
.build());
ctx.export("albSecurityPolicyId2", nameRegex.applyValue(getSecurityPoliciesResult -> getSecurityPoliciesResult.policies()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:alb:getSecurityPolicies
Arguments: {}
nameRegex:
fn::invoke:
Function: alicloud:alb:getSecurityPolicies
Arguments:
nameRegex: ^my-SecurityPolicy
outputs:
albSecurityPolicyId1: ${ids.policies[0].id}
albSecurityPolicyId2: ${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, str]] = 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, pulumi.Input[str]]]] = 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)
}
public static CompletableFuture<GetSecurityPoliciesResult> getSecurityPolicies(GetSecurityPoliciesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:alb/getSecurityPolicies:getSecurityPolicies
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of Security Policy IDs.
- Name
Regex string - A regex string to filter results by Security Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Resource
Group stringId - The ID of the resource group.
- Security
Policy List<string>Ids - The security policy ids.
- Security
Policy stringName - The name of the resource.
- Status string
- The status of the resource. Valid values :
Available
,Configuring
. - Dictionary<string, string>
- Ids []string
- A list of Security Policy IDs.
- Name
Regex string - A regex string to filter results by Security Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Resource
Group stringId - The ID of the resource group.
- Security
Policy []stringIds - The security policy ids.
- Security
Policy stringName - The name of the resource.
- Status string
- The status of the resource. Valid values :
Available
,Configuring
. - map[string]string
- ids List<String>
- A list of Security Policy IDs.
- name
Regex String - A regex string to filter results by Security Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - resource
Group StringId - The ID of the resource group.
- security
Policy List<String>Ids - The security policy ids.
- security
Policy StringName - The name of the resource.
- status String
- The status of the resource. Valid values :
Available
,Configuring
. - Map<String,String>
- ids string[]
- A list of Security Policy IDs.
- name
Regex string - A regex string to filter results by Security Policy name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - resource
Group stringId - The ID of the resource group.
- security
Policy string[]Ids - The security policy ids.
- security
Policy stringName - The name of the resource.
- status string
- The status of the resource. Valid values :
Available
,Configuring
. - {[key: string]: string}
- 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 - File name where to save data source results (after running
pulumi preview
). - resource_
group_ strid - The ID of the resource group.
- security_
policy_ Sequence[str]ids - The security policy ids.
- security_
policy_ strname - The name of the resource.
- status str
- The status of the resource. Valid values :
Available
,Configuring
. - Mapping[str, str]
- ids List<String>
- A list of Security Policy IDs.
- name
Regex String - A regex string to filter results by Security Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - resource
Group StringId - The ID of the resource group.
- security
Policy List<String>Ids - The security policy ids.
- security
Policy StringName - The name of the resource.
- status String
- The status of the resource. Valid values :
Available
,Configuring
. - Map<String>
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.
Ali Cloud. Alb. Outputs. Get Security Policies Policy> - Name
Regex string - Output
File string - Resource
Group stringId - Security
Policy List<string>Ids - Security
Policy stringName - Status string
- Dictionary<string, string>
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Policies
[]Get
Security Policies Policy - Name
Regex string - Output
File string - Resource
Group stringId - Security
Policy []stringIds - Security
Policy stringName - Status string
- map[string]string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies
List<Get
Security Policies Policy> - name
Regex String - output
File String - resource
Group StringId - security
Policy List<String>Ids - security
Policy StringName - status String
- Map<String,String>
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- policies
Get
Security Policies Policy[] - name
Regex string - output
File string - resource
Group stringId - security
Policy string[]Ids - security
Policy stringName - status string
- {[key: string]: string}
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- policies
Sequence[Get
Security Policies Policy] - name_
regex str - output_
file str - resource_
group_ strid - security_
policy_ Sequence[str]ids - security_
policy_ strname - status str
- Mapping[str, str]
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies List<Property Map>
- name
Regex String - output
File String - resource
Group StringId - security
Policy List<String>Ids - security
Policy StringName - status String
- Map<String>
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.
- Resource
Group stringId - The ID of the resource group.
- Security
Policy stringId - The first ID of the resource.
- Security
Policy stringName - 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.
- Tls
Versions 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.
- Resource
Group stringId - The ID of the resource group.
- Security
Policy stringId - The first ID of the resource.
- Security
Policy stringName - 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.
- Tls
Versions []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.
- id String
- The ID of the Security Policy.
- resource
Group StringId - The ID of the resource group.
- security
Policy StringId - The first ID of the resource.
- security
Policy StringName - 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.
- tls
Versions 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.
- resource
Group stringId - The ID of the resource group.
- security
Policy stringId - The first ID of the resource.
- security
Policy stringName - 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.
- tls
Versions 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_ strid - The ID of the resource group.
- security_
policy_ strid - The first ID of the resource.
- security_
policy_ strname - 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.
- ciphers List<String>
- The supported cipher suites, which are determined by the TLS protocol version.
- id String
- The ID of the Security Policy.
- resource
Group StringId - The ID of the resource group.
- security
Policy StringId - The first ID of the resource.
- security
Policy StringName - 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.
- tls
Versions List<String> - The TLS protocol versions that are supported. Valid values: TLSv1.0, TLSv1.1, TLSv1.2 and TLSv1.3.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.