Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.nlb.getSecurityPolicies
Explore with Pulumi AI
This data source provides the Nlb Security Policies of the current Alibaba Cloud user.
NOTE: Available in v1.187.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.nlb.getSecurityPolicies({});
export const nlbSecurityPolicyId1 = ids.then(ids => ids.policies?.[0]?.id);
const nameRegex = alicloud.nlb.getSecurityPolicies({
nameRegex: "^my-SecurityPolicy",
});
export const nlbSecurityPolicyId2 = nameRegex.then(nameRegex => nameRegex.policies?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.nlb.get_security_policies()
pulumi.export("nlbSecurityPolicyId1", ids.policies[0].id)
name_regex = alicloud.nlb.get_security_policies(name_regex="^my-SecurityPolicy")
pulumi.export("nlbSecurityPolicyId2", name_regex.policies[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nlb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := nlb.GetSecurityPolicies(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("nlbSecurityPolicyId1", ids.Policies[0].Id)
nameRegex, err := nlb.GetSecurityPolicies(ctx, &nlb.GetSecurityPoliciesArgs{
NameRegex: pulumi.StringRef("^my-SecurityPolicy"),
}, nil)
if err != nil {
return err
}
ctx.Export("nlbSecurityPolicyId2", 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.Nlb.GetSecurityPolicies.Invoke();
var nameRegex = AliCloud.Nlb.GetSecurityPolicies.Invoke(new()
{
NameRegex = "^my-SecurityPolicy",
});
return new Dictionary<string, object?>
{
["nlbSecurityPolicyId1"] = ids.Apply(getSecurityPoliciesResult => getSecurityPoliciesResult.Policies[0]?.Id),
["nlbSecurityPolicyId2"] = 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.nlb.NlbFunctions;
import com.pulumi.alicloud.nlb.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 = NlbFunctions.getSecurityPolicies();
ctx.export("nlbSecurityPolicyId1", ids.applyValue(getSecurityPoliciesResult -> getSecurityPoliciesResult.policies()[0].id()));
final var nameRegex = NlbFunctions.getSecurityPolicies(GetSecurityPoliciesArgs.builder()
.nameRegex("^my-SecurityPolicy")
.build());
ctx.export("nlbSecurityPolicyId2", nameRegex.applyValue(getSecurityPoliciesResult -> getSecurityPoliciesResult.policies()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:nlb:getSecurityPolicies
Arguments: {}
nameRegex:
fn::invoke:
Function: alicloud:nlb:getSecurityPolicies
Arguments:
nameRegex: ^my-SecurityPolicy
outputs:
nlbSecurityPolicyId1: ${ids.policies[0].id}
nlbSecurityPolicyId2: ${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_names: Optional[Sequence[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_names: Optional[pulumi.Input[Sequence[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:nlb/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>Names - The names of the TLS security policies.
- 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 []stringNames - The names of the TLS security policies.
- 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>Names - The names of the TLS security policies.
- 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[]Names - The names of the TLS security policies.
- 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]names - The names of the TLS security policies.
- 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>Names - The names of the TLS security policies.
- 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. Nlb. Outputs. Get Security Policies Policy> - Name
Regex string - Output
File string - Resource
Group stringId - Security
Policy List<string>Names - 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 []stringNames - 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>Names - 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[]Names - 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]names - 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>Names - 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 TLS security policy.
- Resource
Group stringId - The ID of the resource group.
- Security
Policy stringName - The name of the TLS security policy.
- Status string
- The status of the resource.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Tls
Versions List<string> - The TLS protocol versions that are supported.
- Ciphers []string
- The supported cipher suites, which are determined by the TLS protocol version.
- Id string
- The id of the TLS security policy.
- Resource
Group stringId - The ID of the resource group.
- Security
Policy stringName - The name of the TLS security policy.
- Status string
- The status of the resource.
- map[string]string
- A mapping of tags to assign to the resource.
- Tls
Versions []string - The TLS protocol versions that are supported.
- ciphers List<String>
- The supported cipher suites, which are determined by the TLS protocol version.
- id String
- The id of the TLS security policy.
- resource
Group StringId - The ID of the resource group.
- security
Policy StringName - The name of the TLS security policy.
- status String
- The status of the resource.
- Map<String,String>
- A mapping of tags to assign to the resource.
- tls
Versions List<String> - The TLS protocol versions that are supported.
- ciphers string[]
- The supported cipher suites, which are determined by the TLS protocol version.
- id string
- The id of the TLS security policy.
- resource
Group stringId - The ID of the resource group.
- security
Policy stringName - The name of the TLS security policy.
- status string
- The status of the resource.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- tls
Versions string[] - The TLS protocol versions that are supported.
- ciphers Sequence[str]
- The supported cipher suites, which are determined by the TLS protocol version.
- id str
- The id of the TLS security policy.
- resource_
group_ strid - The ID of the resource group.
- security_
policy_ strname - The name of the TLS security policy.
- status str
- The status of the resource.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- tls_
versions Sequence[str] - The TLS protocol versions that are supported.
- ciphers List<String>
- The supported cipher suites, which are determined by the TLS protocol version.
- id String
- The id of the TLS security policy.
- resource
Group StringId - The ID of the resource group.
- security
Policy StringName - The name of the TLS security policy.
- status String
- The status of the resource.
- Map<String>
- A mapping of tags to assign to the resource.
- tls
Versions List<String> - The TLS protocol versions that are supported.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.