1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ram
  5. getSystemPolicys
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.ram.getSystemPolicys

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

    This data source provides Ram System Policy available to the user.What is System Policy

    NOTE: Available since v1.245.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = alicloud.ram.getSystemPolicys({
        nameRegex: "^AdministratorAccess$",
    });
    export const alicloudRamSystemPolicyExampleId = _default.then(_default => _default.policys?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.ram.get_system_policys(name_regex="^AdministratorAccess$")
    pulumi.export("alicloudRamSystemPolicyExampleId", default.policys[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
    	"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 := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := ram.GetSystemPolicys(ctx, &ram.GetSystemPolicysArgs{
    			NameRegex: pulumi.StringRef("^AdministratorAccess$"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("alicloudRamSystemPolicyExampleId", _default.Policys[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.Ram.GetSystemPolicys.Invoke(new()
        {
            NameRegex = "^AdministratorAccess$",
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudRamSystemPolicyExampleId"] = @default.Apply(@default => @default.Apply(getSystemPolicysResult => getSystemPolicysResult.Policys[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ram.RamFunctions;
    import com.pulumi.alicloud.ram.inputs.GetSystemPolicysArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var default = RamFunctions.getSystemPolicys(GetSystemPolicysArgs.builder()
                .nameRegex("^AdministratorAccess$")
                .build());
    
            ctx.export("alicloudRamSystemPolicyExampleId", default_.policys()[0].id());
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    variables:
      default:
        fn::invoke:
          function: alicloud:ram:getSystemPolicys
          arguments:
            nameRegex: ^AdministratorAccess$
    outputs:
      alicloudRamSystemPolicyExampleId: ${default.policys[0].id}
    

    Using getSystemPolicys

    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 getSystemPolicys(args: GetSystemPolicysArgs, opts?: InvokeOptions): Promise<GetSystemPolicysResult>
    function getSystemPolicysOutput(args: GetSystemPolicysOutputArgs, opts?: InvokeOptions): Output<GetSystemPolicysResult>
    def get_system_policys(ids: Optional[Sequence[str]] = None,
                           name_regex: Optional[str] = None,
                           output_file: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetSystemPolicysResult
    def get_system_policys_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           name_regex: Optional[pulumi.Input[str]] = None,
                           output_file: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetSystemPolicysResult]
    func GetSystemPolicys(ctx *Context, args *GetSystemPolicysArgs, opts ...InvokeOption) (*GetSystemPolicysResult, error)
    func GetSystemPolicysOutput(ctx *Context, args *GetSystemPolicysOutputArgs, opts ...InvokeOption) GetSystemPolicysResultOutput

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

    public static class GetSystemPolicys 
    {
        public static Task<GetSystemPolicysResult> InvokeAsync(GetSystemPolicysArgs args, InvokeOptions? opts = null)
        public static Output<GetSystemPolicysResult> Invoke(GetSystemPolicysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSystemPolicysResult> getSystemPolicys(GetSystemPolicysArgs args, InvokeOptions options)
    public static Output<GetSystemPolicysResult> getSystemPolicys(GetSystemPolicysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:ram/getSystemPolicys:getSystemPolicys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of System Policy IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of System Policy IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of System Policy IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of System Policy IDs.
    nameRegex string
    A regex string to filter results by Group Metric Rule name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of System Policy IDs.
    name_regex str
    A regex string to filter results by Group Metric Rule name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of System Policy IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getSystemPolicys Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of System Policy IDs.
    Names List<string>
    A list of name of System Policys.
    Policys List<Pulumi.AliCloud.Ram.Outputs.GetSystemPolicysPolicy>
    A list of System Policy Entries. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of System Policy IDs.
    Names []string
    A list of name of System Policys.
    Policys []GetSystemPolicysPolicy
    A list of System Policy Entries. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of System Policy IDs.
    names List<String>
    A list of name of System Policys.
    policys List<GetSystemPolicysPolicy>
    A list of System Policy Entries. Each element contains the following attributes:
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of System Policy IDs.
    names string[]
    A list of name of System Policys.
    policys GetSystemPolicysPolicy[]
    A list of System Policy Entries. Each element contains the following attributes:
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of System Policy IDs.
    names Sequence[str]
    A list of name of System Policys.
    policys Sequence[GetSystemPolicysPolicy]
    A list of System Policy Entries. Each element contains the following attributes:
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of System Policy IDs.
    names List<String>
    A list of name of System Policys.
    policys List<Property Map>
    A list of System Policy Entries. Each element contains the following attributes:
    nameRegex String
    outputFile String

    Supporting Types

    GetSystemPolicysPolicy

    AttachmentCount int
    Number of references.
    CreateTime string
    Creation time.
    Description string
    The permission policy description.
    Id string
    The ID of the resource supplied above.
    PolicyName string
    The permission policy name.
    PolicyType string
    Permission policy type.
    UpdateDate string
    Modification time.
    AttachmentCount int
    Number of references.
    CreateTime string
    Creation time.
    Description string
    The permission policy description.
    Id string
    The ID of the resource supplied above.
    PolicyName string
    The permission policy name.
    PolicyType string
    Permission policy type.
    UpdateDate string
    Modification time.
    attachmentCount Integer
    Number of references.
    createTime String
    Creation time.
    description String
    The permission policy description.
    id String
    The ID of the resource supplied above.
    policyName String
    The permission policy name.
    policyType String
    Permission policy type.
    updateDate String
    Modification time.
    attachmentCount number
    Number of references.
    createTime string
    Creation time.
    description string
    The permission policy description.
    id string
    The ID of the resource supplied above.
    policyName string
    The permission policy name.
    policyType string
    Permission policy type.
    updateDate string
    Modification time.
    attachment_count int
    Number of references.
    create_time str
    Creation time.
    description str
    The permission policy description.
    id str
    The ID of the resource supplied above.
    policy_name str
    The permission policy name.
    policy_type str
    Permission policy type.
    update_date str
    Modification time.
    attachmentCount Number
    Number of references.
    createTime String
    Creation time.
    description String
    The permission policy description.
    id String
    The ID of the resource supplied above.
    policyName String
    The permission policy name.
    policyType String
    Permission policy type.
    updateDate String
    Modification time.

    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.76.0 published on Tuesday, Apr 8, 2025 by Pulumi