We recommend new projects start with resources from the AWS provider.
aws-native.iam.getRolePolicy
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
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:
- Policy
Name 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: _+=,.@-
- Role
Name 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 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: _+=,.@-
- Role
Name 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 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: _+=,.@-
- role
Name 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 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: _+=,.@-
- role
Name 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: _+=,.@-
- policy
Name 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: _+=,.@-
- role
Name 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:
- Policy
Document 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.- Any printable ASCII character ranging from the space character (
- Policy
Document 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.- Any printable ASCII character ranging from the space character (
- policy
Document 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.- Any printable ASCII character ranging from the space character (
- 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.- Any printable ASCII character ranging from the space character (
- 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.- Any printable ASCII character ranging from the space character (
- 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.- Any printable ASCII character ranging from the space character (
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.