AWS Native is in preview. AWS Classic is fully supported.
aws-native.iam.getUserPolicy
Explore with Pulumi AI
AWS Native is in preview. AWS Classic is fully supported.
Adds or updates an inline policy document that is embedded in the specified IAM user. An IAM user can also have a managed policy attached to it. To attach a managed policy to a user, use AWS::IAM::User. 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 in a user, see IAM and quotas in the IAM User Guide.
Using getUserPolicy
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 getUserPolicy(args: GetUserPolicyArgs, opts?: InvokeOptions): Promise<GetUserPolicyResult>
function getUserPolicyOutput(args: GetUserPolicyOutputArgs, opts?: InvokeOptions): Output<GetUserPolicyResult>
def get_user_policy(policy_name: Optional[str] = None,
user_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetUserPolicyResult
def get_user_policy_output(policy_name: Optional[pulumi.Input[str]] = None,
user_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetUserPolicyResult]
func LookupUserPolicy(ctx *Context, args *LookupUserPolicyArgs, opts ...InvokeOption) (*LookupUserPolicyResult, error)
func LookupUserPolicyOutput(ctx *Context, args *LookupUserPolicyOutputArgs, opts ...InvokeOption) LookupUserPolicyResultOutput
> Note: This function is named LookupUserPolicy
in the Go SDK.
public static class GetUserPolicy
{
public static Task<GetUserPolicyResult> InvokeAsync(GetUserPolicyArgs args, InvokeOptions? opts = null)
public static Output<GetUserPolicyResult> Invoke(GetUserPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetUserPolicyResult> getUserPolicy(GetUserPolicyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws-native:iam:getUserPolicy
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: _+=,.@-
- User
Name string - The name of the user 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: _+=,.@-
- User
Name string - The name of the user 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: _+=,.@-
- user
Name String - The name of the user 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: _+=,.@-
- user
Name string - The name of the user 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: _+=,.@-
- user_
name str - The name of the user 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: _+=,.@-
- user
Name String - The name of the user 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: _+=,.@-
getUserPolicy 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::UserPolicy
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::UserPolicy
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::UserPolicy
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::UserPolicy
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::UserPolicy
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::UserPolicy
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
AWS Native is in preview. AWS Classic is fully supported.