1. Packages
  2. AWS Native
  3. API Docs
  4. iam
  5. getRolePolicy

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws-native.iam.getRolePolicy

Explore with Pulumi AI

aws-native logo

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline policy in a role, the inline policy is used as part of the role’s access (permissions) policy. The role’s trust policy is created at the same time as the role, using CreateRole. You can update a role’s trust policy using UpdateAssumeRolePolicy. For information about roles, see roles in the IAM User Guide. A role can also have a managed policy attached to it. To attach a managed policy to a role, use AWS::IAM::Role. To create a new managed policy, use AWS::IAM::ManagedPolicy. For information about policies, see Managed policies and inline policies in the IAM User Guide. For information about the maximum number of inline policies that you can embed with a role, see IAM and quotas in the IAM User Guide.

    Using getRolePolicy

    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 getRolePolicy(args: GetRolePolicyArgs, opts?: InvokeOptions): Promise<GetRolePolicyResult>
    function getRolePolicyOutput(args: GetRolePolicyOutputArgs, opts?: InvokeOptions): Output<GetRolePolicyResult>
    def get_role_policy(policy_name: Optional[str] = None,
                        role_name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetRolePolicyResult
    def get_role_policy_output(policy_name: Optional[pulumi.Input[str]] = None,
                        role_name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetRolePolicyResult]
    func LookupRolePolicy(ctx *Context, args *LookupRolePolicyArgs, opts ...InvokeOption) (*LookupRolePolicyResult, error)
    func LookupRolePolicyOutput(ctx *Context, args *LookupRolePolicyOutputArgs, opts ...InvokeOption) LookupRolePolicyResultOutput

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

    public static class GetRolePolicy 
    {
        public static Task<GetRolePolicyResult> InvokeAsync(GetRolePolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetRolePolicyResult> Invoke(GetRolePolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRolePolicyResult> getRolePolicy(GetRolePolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws-native:iam:getRolePolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    PolicyName string
    The name of the policy document. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    RoleName string
    The name of the role to associate the policy with. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    PolicyName string
    The name of the policy document. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    RoleName string
    The name of the role to associate the policy with. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    policyName String
    The name of the policy document. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    roleName String
    The name of the role to associate the policy with. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    policyName string
    The name of the policy document. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    roleName string
    The name of the role to associate the policy with. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    policy_name str
    The name of the policy document. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    role_name str
    The name of the role to associate the policy with. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    policyName String
    The name of the policy document. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
    roleName String
    The name of the role to associate the policy with. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

    getRolePolicy Result

    The following output properties are available:

    PolicyDocument object

    The policy document. You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM. The regex pattern used to validate this parameter is a string of characters consisting of the following:

    • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
    • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
    • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

    Search the CloudFormation User Guide for AWS::IAM::RolePolicy for more information about the expected schema for this property.

    PolicyDocument interface{}

    The policy document. You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM. The regex pattern used to validate this parameter is a string of characters consisting of the following:

    • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
    • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
    • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

    Search the CloudFormation User Guide for AWS::IAM::RolePolicy for more information about the expected schema for this property.

    policyDocument Object

    The policy document. You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM. The regex pattern used to validate this parameter is a string of characters consisting of the following:

    • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
    • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
    • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

    Search the CloudFormation User Guide for AWS::IAM::RolePolicy for more information about the expected schema for this property.

    policyDocument any

    The policy document. You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM. The regex pattern used to validate this parameter is a string of characters consisting of the following:

    • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
    • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
    • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

    Search the CloudFormation User Guide for AWS::IAM::RolePolicy for more information about the expected schema for this property.

    policy_document Any

    The policy document. You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM. The regex pattern used to validate this parameter is a string of characters consisting of the following:

    • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
    • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
    • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

    Search the CloudFormation User Guide for AWS::IAM::RolePolicy for more information about the expected schema for this property.

    policyDocument Any

    The policy document. You must provide policies in JSON format in IAM. However, for CFN templates formatted in YAML, you can provide the policy in JSON or YAML format. CFN always converts a YAML policy to JSON format before submitting it to IAM. The regex pattern used to validate this parameter is a string of characters consisting of the following:

    • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
    • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
    • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

    Search the CloudFormation User Guide for AWS::IAM::RolePolicy for more information about the expected schema for this property.

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    AWS Native is in preview. AWS Classic is fully supported.

    AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi