Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine
volcengine.iam.Policies
Explore with Pulumi AI
Use this data source to query detailed information of iam policies
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() => 
{
    var fooPolicy = new Volcengine.Iam.Policy("fooPolicy", new()
    {
        PolicyName = "acc-test-policy",
        Description = "acc-test",
        PolicyDocument = "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
    });
    var fooPolicies = Volcengine.Iam.Policies.Invoke(new()
    {
        Query = fooPolicy.Description,
    });
});
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/iam"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooPolicy, err := iam.NewPolicy(ctx, "fooPolicy", &iam.PolicyArgs{
			PolicyName:     pulumi.String("acc-test-policy"),
			Description:    pulumi.String("acc-test"),
			PolicyDocument: pulumi.String("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}"),
		})
		if err != nil {
			return err
		}
		_ = fooPolicy.Description.ApplyT(func(description *string) (iam.PoliciesResult, error) {
			return iam.PoliciesOutput(ctx, iam.PoliciesOutputArgs{
				Query: description,
			}, nil), nil
		}).(iam.PoliciesResultOutput)
		return nil
	})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.iam.Policy;
import com.pulumi.volcengine.iam.PolicyArgs;
import com.pulumi.volcengine.iam.IamFunctions;
import com.pulumi.volcengine.iam.inputs.PoliciesArgs;
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) {
        var fooPolicy = new Policy("fooPolicy", PolicyArgs.builder()        
            .policyName("acc-test-policy")
            .description("acc-test")
            .policyDocument("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}")
            .build());
        final var fooPolicies = IamFunctions.Policies(PoliciesArgs.builder()
            .query(fooPolicy.description())
            .build());
    }
}
import pulumi
import pulumi_volcengine as volcengine
foo_policy = volcengine.iam.Policy("fooPolicy",
    policy_name="acc-test-policy",
    description="acc-test",
    policy_document="{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}")
foo_policies = foo_policy.description.apply(lambda description: volcengine.iam.policies_output(query=description))
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";
const fooPolicy = new volcengine.iam.Policy("fooPolicy", {
    policyName: "acc-test-policy",
    description: "acc-test",
    policyDocument: "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
});
const fooPolicies = fooPolicy.description.apply(description => volcengine.iam.PoliciesOutput({
    query: description,
}));
resources:
  fooPolicy:
    type: volcengine:iam:Policy
    properties:
      policyName: acc-test-policy
      description: acc-test
      policyDocument: '{"Statement":[{"Effect":"Allow","Action":["auto_scaling:DescribeScalingGroups"],"Resource":["*"]}]}'
variables:
  fooPolicies:
    fn::invoke:
      Function: volcengine:iam:Policies
      Arguments:
        query: ${fooPolicy.description}
Using Policies
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 policies(args: PoliciesArgs, opts?: InvokeOptions): Promise<PoliciesResult>
function policiesOutput(args: PoliciesOutputArgs, opts?: InvokeOptions): Output<PoliciesResult>def policies(name_regex: Optional[str] = None,
             output_file: Optional[str] = None,
             query: Optional[str] = None,
             role_name: Optional[str] = None,
             scope: Optional[str] = None,
             status: Optional[str] = None,
             user_name: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> PoliciesResult
def policies_output(name_regex: Optional[pulumi.Input[str]] = None,
             output_file: Optional[pulumi.Input[str]] = None,
             query: Optional[pulumi.Input[str]] = None,
             role_name: Optional[pulumi.Input[str]] = None,
             scope: Optional[pulumi.Input[str]] = None,
             status: Optional[pulumi.Input[str]] = None,
             user_name: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[PoliciesResult]func Policies(ctx *Context, args *PoliciesArgs, opts ...InvokeOption) (*PoliciesResult, error)
func PoliciesOutput(ctx *Context, args *PoliciesOutputArgs, opts ...InvokeOption) PoliciesResultOutputpublic static class Policies 
{
    public static Task<PoliciesResult> InvokeAsync(PoliciesArgs args, InvokeOptions? opts = null)
    public static Output<PoliciesResult> Invoke(PoliciesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<PoliciesResult> policies(PoliciesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: volcengine:iam:Policies
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name
Regex string - A Name Regex of Policy.
 - Output
File string - File name where to save data source results.
 - Query string
 - Query policies, support policy name or description.
 - Role
Name string - The name of the IAM role.
 - Scope string
 - The scope of the Policy.
 - Status string
 - The status of policy.
 - User
Name string - The name of the IAM user.
 
- Name
Regex string - A Name Regex of Policy.
 - Output
File string - File name where to save data source results.
 - Query string
 - Query policies, support policy name or description.
 - Role
Name string - The name of the IAM role.
 - Scope string
 - The scope of the Policy.
 - Status string
 - The status of policy.
 - User
Name string - The name of the IAM user.
 
- name
Regex String - A Name Regex of Policy.
 - output
File String - File name where to save data source results.
 - query String
 - Query policies, support policy name or description.
 - role
Name String - The name of the IAM role.
 - scope String
 - The scope of the Policy.
 - status String
 - The status of policy.
 - user
Name String - The name of the IAM user.
 
- name
Regex string - A Name Regex of Policy.
 - output
File string - File name where to save data source results.
 - query string
 - Query policies, support policy name or description.
 - role
Name string - The name of the IAM role.
 - scope string
 - The scope of the Policy.
 - status string
 - The status of policy.
 - user
Name string - The name of the IAM user.
 
- name_
regex str - A Name Regex of Policy.
 - output_
file str - File name where to save data source results.
 - query str
 - Query policies, support policy name or description.
 - role_
name str - The name of the IAM role.
 - scope str
 - The scope of the Policy.
 - status str
 - The status of policy.
 - user_
name str - The name of the IAM user.
 
- name
Regex String - A Name Regex of Policy.
 - output
File String - File name where to save data source results.
 - query String
 - Query policies, support policy name or description.
 - role
Name String - The name of the IAM role.
 - scope String
 - The scope of the Policy.
 - status String
 - The status of policy.
 - user
Name String - The name of the IAM user.
 
Policies Result
The following output properties are available:
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Policies
List<Policies
Policy>  - The collection of Policy query.
 - Total
Count int - The total count of Policy query.
 - Name
Regex string - Output
File string - Query string
 - Role
Name string - The name of the IAM role.The data show only query with role_name.
 - Scope string
 - Status string
 - User
Name string - The name of the IAM user.The data show only query with user_name.
 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Policies
[]Policies
Policy  - The collection of Policy query.
 - Total
Count int - The total count of Policy query.
 - Name
Regex string - Output
File string - Query string
 - Role
Name string - The name of the IAM role.The data show only query with role_name.
 - Scope string
 - Status string
 - User
Name string - The name of the IAM user.The data show only query with user_name.
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - policies
List<Policies
Policy>  - The collection of Policy query.
 - total
Count Integer - The total count of Policy query.
 - name
Regex String - output
File String - query String
 - role
Name String - The name of the IAM role.The data show only query with role_name.
 - scope String
 - status String
 - user
Name String - The name of the IAM user.The data show only query with user_name.
 
- id string
 - The provider-assigned unique ID for this managed resource.
 - policies
Policies
Policy[]  - The collection of Policy query.
 - total
Count number - The total count of Policy query.
 - name
Regex string - output
File string - query string
 - role
Name string - The name of the IAM role.The data show only query with role_name.
 - scope string
 - status string
 - user
Name string - The name of the IAM user.The data show only query with user_name.
 
- id str
 - The provider-assigned unique ID for this managed resource.
 - policies
Sequence[Policies
Policy]  - The collection of Policy query.
 - total_
count int - The total count of Policy query.
 - name_
regex str - output_
file str - query str
 - role_
name str - The name of the IAM role.The data show only query with role_name.
 - scope str
 - status str
 - user_
name str - The name of the IAM user.The data show only query with user_name.
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - policies List<Property Map>
 - The collection of Policy query.
 - total
Count Number - The total count of Policy query.
 - name
Regex String - output
File String - query String
 - role
Name String - The name of the IAM role.The data show only query with role_name.
 - scope String
 - status String
 - user
Name String - The name of the IAM user.The data show only query with user_name.
 
Supporting Types
PoliciesPolicy 
- Create
Date string - The create time of the Policy.
 - Description string
 - The description of the Policy.
 - Id string
 - The ID of the Policy.
 - Policy
Document string - The document of the Policy.
 - Policy
Name string - The name of the Policy.
 - Policy
Trn string - The resource name of the Policy.
 - Policy
Type string - The type of the Policy.
 - Role
Attach stringDate  - The role attach time of the Policy.The data show only query with role_name.
 - Role
Name string - The name of the IAM role.
 - Update
Date string - The update time of the Policy.
 - User
Attach stringDate  - The user attach time of the Policy.The data show only query with user_name.
 - User
Name string - The name of the IAM user.
 
- Create
Date string - The create time of the Policy.
 - Description string
 - The description of the Policy.
 - Id string
 - The ID of the Policy.
 - Policy
Document string - The document of the Policy.
 - Policy
Name string - The name of the Policy.
 - Policy
Trn string - The resource name of the Policy.
 - Policy
Type string - The type of the Policy.
 - Role
Attach stringDate  - The role attach time of the Policy.The data show only query with role_name.
 - Role
Name string - The name of the IAM role.
 - Update
Date string - The update time of the Policy.
 - User
Attach stringDate  - The user attach time of the Policy.The data show only query with user_name.
 - User
Name string - The name of the IAM user.
 
- create
Date String - The create time of the Policy.
 - description String
 - The description of the Policy.
 - id String
 - The ID of the Policy.
 - policy
Document String - The document of the Policy.
 - policy
Name String - The name of the Policy.
 - policy
Trn String - The resource name of the Policy.
 - policy
Type String - The type of the Policy.
 - role
Attach StringDate  - The role attach time of the Policy.The data show only query with role_name.
 - role
Name String - The name of the IAM role.
 - update
Date String - The update time of the Policy.
 - user
Attach StringDate  - The user attach time of the Policy.The data show only query with user_name.
 - user
Name String - The name of the IAM user.
 
- create
Date string - The create time of the Policy.
 - description string
 - The description of the Policy.
 - id string
 - The ID of the Policy.
 - policy
Document string - The document of the Policy.
 - policy
Name string - The name of the Policy.
 - policy
Trn string - The resource name of the Policy.
 - policy
Type string - The type of the Policy.
 - role
Attach stringDate  - The role attach time of the Policy.The data show only query with role_name.
 - role
Name string - The name of the IAM role.
 - update
Date string - The update time of the Policy.
 - user
Attach stringDate  - The user attach time of the Policy.The data show only query with user_name.
 - user
Name string - The name of the IAM user.
 
- create_
date str - The create time of the Policy.
 - description str
 - The description of the Policy.
 - id str
 - The ID of the Policy.
 - policy_
document str - The document of the Policy.
 - policy_
name str - The name of the Policy.
 - policy_
trn str - The resource name of the Policy.
 - policy_
type str - The type of the Policy.
 - role_
attach_ strdate  - The role attach time of the Policy.The data show only query with role_name.
 - role_
name str - The name of the IAM role.
 - update_
date str - The update time of the Policy.
 - user_
attach_ strdate  - The user attach time of the Policy.The data show only query with user_name.
 - user_
name str - The name of the IAM user.
 
- create
Date String - The create time of the Policy.
 - description String
 - The description of the Policy.
 - id String
 - The ID of the Policy.
 - policy
Document String - The document of the Policy.
 - policy
Name String - The name of the Policy.
 - policy
Trn String - The resource name of the Policy.
 - policy
Type String - The type of the Policy.
 - role
Attach StringDate  - The role attach time of the Policy.The data show only query with role_name.
 - role
Name String - The name of the IAM role.
 - update
Date String - The update time of the Policy.
 - user
Attach StringDate  - The user attach time of the Policy.The data show only query with user_name.
 - user
Name String - The name of the IAM user.
 
Package Details
- Repository
 - volcengine volcengine/pulumi-volcengine
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
volcengineTerraform Provider.