Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine
volcengine.iam.Policies
Explore with Pulumi AI
Use this data source to query detailed information of iam policies
Example Usage
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,
}));
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))
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
	})
}
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 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());
    }
}
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)
public static Output<PoliciesResult> policies(PoliciesArgs args, InvokeOptions options)
fn::invoke:
  function: volcengine:iam:Policies
  arguments:
    # arguments dictionaryThe following arguments are supported:
- NameRegex string
- A Name Regex of Policy.
- OutputFile string
- File name where to save data source results.
- Query string
- Query policies, support policy name or description.
- RoleName string
- The name of the IAM role.
- Scope string
- The scope of the Policy.
- Status string
- The status of policy.
- UserName string
- The name of the IAM user.
- NameRegex string
- A Name Regex of Policy.
- OutputFile string
- File name where to save data source results.
- Query string
- Query policies, support policy name or description.
- RoleName string
- The name of the IAM role.
- Scope string
- The scope of the Policy.
- Status string
- The status of policy.
- UserName string
- The name of the IAM user.
- nameRegex String
- A Name Regex of Policy.
- outputFile String
- File name where to save data source results.
- query String
- Query policies, support policy name or description.
- roleName String
- The name of the IAM role.
- scope String
- The scope of the Policy.
- status String
- The status of policy.
- userName String
- The name of the IAM user.
- nameRegex string
- A Name Regex of Policy.
- outputFile string
- File name where to save data source results.
- query string
- Query policies, support policy name or description.
- roleName string
- The name of the IAM role.
- scope string
- The scope of the Policy.
- status string
- The status of policy.
- userName 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.
- nameRegex String
- A Name Regex of Policy.
- outputFile String
- File name where to save data source results.
- query String
- Query policies, support policy name or description.
- roleName String
- The name of the IAM role.
- scope String
- The scope of the Policy.
- status String
- The status of policy.
- userName 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<PoliciesPolicy> 
- The collection of Policy query.
- TotalCount int
- The total count of Policy query.
- NameRegex string
- OutputFile string
- Query string
- RoleName string
- The name of the IAM role.The data show only query with role_name.
- Scope string
- Status string
- UserName 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
[]PoliciesPolicy 
- The collection of Policy query.
- TotalCount int
- The total count of Policy query.
- NameRegex string
- OutputFile string
- Query string
- RoleName string
- The name of the IAM role.The data show only query with role_name.
- Scope string
- Status string
- UserName 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<PoliciesPolicy> 
- The collection of Policy query.
- totalCount Integer
- The total count of Policy query.
- nameRegex String
- outputFile String
- query String
- roleName String
- The name of the IAM role.The data show only query with role_name.
- scope String
- status String
- userName 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
PoliciesPolicy[] 
- The collection of Policy query.
- totalCount number
- The total count of Policy query.
- nameRegex string
- outputFile string
- query string
- roleName string
- The name of the IAM role.The data show only query with role_name.
- scope string
- status string
- userName 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[PoliciesPolicy] 
- 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.
- totalCount Number
- The total count of Policy query.
- nameRegex String
- outputFile String
- query String
- roleName String
- The name of the IAM role.The data show only query with role_name.
- scope String
- status String
- userName String
- The name of the IAM user.The data show only query with user_name.
Supporting Types
PoliciesPolicy 
- CreateDate string
- The create time of the Policy.
- Description string
- The description of the Policy.
- Id string
- The ID of the Policy.
- PolicyDocument string
- The document of the Policy.
- PolicyName string
- The name of the Policy.
- PolicyTrn string
- The resource name of the Policy.
- PolicyType string
- The type of the Policy.
- RoleAttach stringDate 
- The role attach time of the Policy.The data show only query with role_name.
- RoleName string
- The name of the IAM role.
- UpdateDate string
- The update time of the Policy.
- UserAttach stringDate 
- The user attach time of the Policy.The data show only query with user_name.
- UserName string
- The name of the IAM user.
- CreateDate string
- The create time of the Policy.
- Description string
- The description of the Policy.
- Id string
- The ID of the Policy.
- PolicyDocument string
- The document of the Policy.
- PolicyName string
- The name of the Policy.
- PolicyTrn string
- The resource name of the Policy.
- PolicyType string
- The type of the Policy.
- RoleAttach stringDate 
- The role attach time of the Policy.The data show only query with role_name.
- RoleName string
- The name of the IAM role.
- UpdateDate string
- The update time of the Policy.
- UserAttach stringDate 
- The user attach time of the Policy.The data show only query with user_name.
- UserName string
- The name of the IAM user.
- createDate String
- The create time of the Policy.
- description String
- The description of the Policy.
- id String
- The ID of the Policy.
- policyDocument String
- The document of the Policy.
- policyName String
- The name of the Policy.
- policyTrn String
- The resource name of the Policy.
- policyType String
- The type of the Policy.
- roleAttach StringDate 
- The role attach time of the Policy.The data show only query with role_name.
- roleName String
- The name of the IAM role.
- updateDate String
- The update time of the Policy.
- userAttach StringDate 
- The user attach time of the Policy.The data show only query with user_name.
- userName String
- The name of the IAM user.
- createDate string
- The create time of the Policy.
- description string
- The description of the Policy.
- id string
- The ID of the Policy.
- policyDocument string
- The document of the Policy.
- policyName string
- The name of the Policy.
- policyTrn string
- The resource name of the Policy.
- policyType string
- The type of the Policy.
- roleAttach stringDate 
- The role attach time of the Policy.The data show only query with role_name.
- roleName string
- The name of the IAM role.
- updateDate string
- The update time of the Policy.
- userAttach stringDate 
- The user attach time of the Policy.The data show only query with user_name.
- userName 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.
- createDate String
- The create time of the Policy.
- description String
- The description of the Policy.
- id String
- The ID of the Policy.
- policyDocument String
- The document of the Policy.
- policyName String
- The name of the Policy.
- policyTrn String
- The resource name of the Policy.
- policyType String
- The type of the Policy.
- roleAttach StringDate 
- The role attach time of the Policy.The data show only query with role_name.
- roleName String
- The name of the IAM role.
- updateDate String
- The update time of the Policy.
- userAttach StringDate 
- The user attach time of the Policy.The data show only query with user_name.
- userName 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.