GetPolicy

This data source can be used to fetch information about a specific IAM policy.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Iam.GetPolicy.InvokeAsync(new Aws.Iam.GetPolicyArgs
        {
            Arn = "arn:aws:iam::123456789012:policy/UsersManageOwnCredentials",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := iam.LookupPolicy(ctx, &iam.LookupPolicyArgs{
            Arn: "arn:aws:iam::123456789012:policy/UsersManageOwnCredentials",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.iam.get_policy(arn="arn:aws:iam::123456789012:policy/UsersManageOwnCredentials")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.iam.getPolicy({
    arn: "arn:aws:iam::123456789012:policy/UsersManageOwnCredentials",
}, { async: true }));

Using GetPolicy

function getPolicy(args: GetPolicyArgs, opts?: InvokeOptions): Promise<GetPolicyResult>
function  get_policy(arn=None, opts=None)
func LookupPolicy(ctx *Context, args *LookupPolicyArgs, opts ...InvokeOption) (*LookupPolicyResult, error)

Note: This function is named LookupPolicy in the Go SDK.

public static class GetPolicy {
    public static Task<GetPolicyResult> InvokeAsync(GetPolicyArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Arn string

ARN of the IAM policy.

Arn string

ARN of the IAM policy.

arn string

ARN of the IAM policy.

arn str

ARN of the IAM policy.

GetPolicy Result

The following output properties are available:

Arn string

The Amazon Resource Name (ARN) specifying the policy.

Description string

The description of the policy.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the IAM policy.

Path string

The path to the policy.

Policy string

The policy document of the policy.

Arn string

The Amazon Resource Name (ARN) specifying the policy.

Description string

The description of the policy.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the IAM policy.

Path string

The path to the policy.

Policy string

The policy document of the policy.

arn string

The Amazon Resource Name (ARN) specifying the policy.

description string

The description of the policy.

id string

The provider-assigned unique ID for this managed resource.

name string

The name of the IAM policy.

path string

The path to the policy.

policy string

The policy document of the policy.

arn str

The Amazon Resource Name (ARN) specifying the policy.

description str

The description of the policy.

id str

The provider-assigned unique ID for this managed resource.

name str

The name of the IAM policy.

path str

The path to the policy.

policy str

The policy document of the policy.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.