1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. iam
  5. getManagedPolicy

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.9.0 published on Monday, Nov 18, 2024 by Pulumi

aws-native.iam.getManagedPolicy

Explore with Pulumi AI

aws-native logo

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.9.0 published on Monday, Nov 18, 2024 by Pulumi

    Creates a new managed policy for your AWS-account. This operation creates a policy version with a version identifier of v1 and sets v1 as the policy’s default version. For more information about policy versions, see Versioning for managed policies in the IAM User Guide. As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide. For more information about managed policies in general, see Managed policies and inline policies in the IAM User Guide.

    Using getManagedPolicy

    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 getManagedPolicy(args: GetManagedPolicyArgs, opts?: InvokeOptions): Promise<GetManagedPolicyResult>
    function getManagedPolicyOutput(args: GetManagedPolicyOutputArgs, opts?: InvokeOptions): Output<GetManagedPolicyResult>
    def get_managed_policy(policy_arn: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetManagedPolicyResult
    def get_managed_policy_output(policy_arn: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetManagedPolicyResult]
    func LookupManagedPolicy(ctx *Context, args *LookupManagedPolicyArgs, opts ...InvokeOption) (*LookupManagedPolicyResult, error)
    func LookupManagedPolicyOutput(ctx *Context, args *LookupManagedPolicyOutputArgs, opts ...InvokeOption) LookupManagedPolicyResultOutput

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

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

    The following arguments are supported:

    PolicyArn string
    PolicyArn string
    policyArn String
    policyArn string
    policyArn String

    getManagedPolicy Result

    The following output properties are available:

    AttachmentCount int
    CreateDate string
    DefaultVersionId string
    Groups List<string>
    The name (friendly name, not ARN) of the group to attach the policy to. 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: _+=,.@-
    IsAttachable bool
    PermissionsBoundaryUsageCount int
    PolicyArn string
    PolicyDocument object

    The JSON policy document that you want to use as the content for the new policy. 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 maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and character quotas. To learn more about JSON policy grammar, see Grammar of the IAM JSON policy language in the IAM User Guide. 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::ManagedPolicy for more information about the expected schema for this property.

    PolicyId string
    Roles List<string>
    The name (friendly name, not ARN) of the role to attach the policy to. This parameter allows (per 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: _+=,.@- If an external policy (such as AWS::IAM::Policy or AWS::IAM::ManagedPolicy) has a Ref to a role and if a resource (such as AWS::ECS::Service) also has a Ref to the same role, add a DependsOn attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with an AWS::ECS::Service resource, the DependsOn attribute ensures that CFN deletes the AWS::ECS::Service resource before deleting its role's policy.
    UpdateDate string
    Users List<string>
    The name (friendly name, not ARN) of the IAM user to attach the policy to. 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: _+=,.@-
    AttachmentCount int
    CreateDate string
    DefaultVersionId string
    Groups []string
    The name (friendly name, not ARN) of the group to attach the policy to. 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: _+=,.@-
    IsAttachable bool
    PermissionsBoundaryUsageCount int
    PolicyArn string
    PolicyDocument interface{}

    The JSON policy document that you want to use as the content for the new policy. 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 maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and character quotas. To learn more about JSON policy grammar, see Grammar of the IAM JSON policy language in the IAM User Guide. 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::ManagedPolicy for more information about the expected schema for this property.

    PolicyId string
    Roles []string
    The name (friendly name, not ARN) of the role to attach the policy to. This parameter allows (per 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: _+=,.@- If an external policy (such as AWS::IAM::Policy or AWS::IAM::ManagedPolicy) has a Ref to a role and if a resource (such as AWS::ECS::Service) also has a Ref to the same role, add a DependsOn attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with an AWS::ECS::Service resource, the DependsOn attribute ensures that CFN deletes the AWS::ECS::Service resource before deleting its role's policy.
    UpdateDate string
    Users []string
    The name (friendly name, not ARN) of the IAM user to attach the policy to. 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: _+=,.@-
    attachmentCount Integer
    createDate String
    defaultVersionId String
    groups List<String>
    The name (friendly name, not ARN) of the group to attach the policy to. 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: _+=,.@-
    isAttachable Boolean
    permissionsBoundaryUsageCount Integer
    policyArn String
    policyDocument Object

    The JSON policy document that you want to use as the content for the new policy. 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 maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and character quotas. To learn more about JSON policy grammar, see Grammar of the IAM JSON policy language in the IAM User Guide. 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::ManagedPolicy for more information about the expected schema for this property.

    policyId String
    roles List<String>
    The name (friendly name, not ARN) of the role to attach the policy to. This parameter allows (per 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: _+=,.@- If an external policy (such as AWS::IAM::Policy or AWS::IAM::ManagedPolicy) has a Ref to a role and if a resource (such as AWS::ECS::Service) also has a Ref to the same role, add a DependsOn attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with an AWS::ECS::Service resource, the DependsOn attribute ensures that CFN deletes the AWS::ECS::Service resource before deleting its role's policy.
    updateDate String
    users List<String>
    The name (friendly name, not ARN) of the IAM user to attach the policy to. 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: _+=,.@-
    attachmentCount number
    createDate string
    defaultVersionId string
    groups string[]
    The name (friendly name, not ARN) of the group to attach the policy to. 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: _+=,.@-
    isAttachable boolean
    permissionsBoundaryUsageCount number
    policyArn string
    policyDocument any

    The JSON policy document that you want to use as the content for the new policy. 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 maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and character quotas. To learn more about JSON policy grammar, see Grammar of the IAM JSON policy language in the IAM User Guide. 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::ManagedPolicy for more information about the expected schema for this property.

    policyId string
    roles string[]
    The name (friendly name, not ARN) of the role to attach the policy to. This parameter allows (per 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: _+=,.@- If an external policy (such as AWS::IAM::Policy or AWS::IAM::ManagedPolicy) has a Ref to a role and if a resource (such as AWS::ECS::Service) also has a Ref to the same role, add a DependsOn attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with an AWS::ECS::Service resource, the DependsOn attribute ensures that CFN deletes the AWS::ECS::Service resource before deleting its role's policy.
    updateDate string
    users string[]
    The name (friendly name, not ARN) of the IAM user to attach the policy to. 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: _+=,.@-
    attachment_count int
    create_date str
    default_version_id str
    groups Sequence[str]
    The name (friendly name, not ARN) of the group to attach the policy to. 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: _+=,.@-
    is_attachable bool
    permissions_boundary_usage_count int
    policy_arn str
    policy_document Any

    The JSON policy document that you want to use as the content for the new policy. 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 maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and character quotas. To learn more about JSON policy grammar, see Grammar of the IAM JSON policy language in the IAM User Guide. 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::ManagedPolicy for more information about the expected schema for this property.

    policy_id str
    roles Sequence[str]
    The name (friendly name, not ARN) of the role to attach the policy to. This parameter allows (per 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: _+=,.@- If an external policy (such as AWS::IAM::Policy or AWS::IAM::ManagedPolicy) has a Ref to a role and if a resource (such as AWS::ECS::Service) also has a Ref to the same role, add a DependsOn attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with an AWS::ECS::Service resource, the DependsOn attribute ensures that CFN deletes the AWS::ECS::Service resource before deleting its role's policy.
    update_date str
    users Sequence[str]
    The name (friendly name, not ARN) of the IAM user to attach the policy to. 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: _+=,.@-
    attachmentCount Number
    createDate String
    defaultVersionId String
    groups List<String>
    The name (friendly name, not ARN) of the group to attach the policy to. 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: _+=,.@-
    isAttachable Boolean
    permissionsBoundaryUsageCount Number
    policyArn String
    policyDocument Any

    The JSON policy document that you want to use as the content for the new policy. 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 maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and character quotas. To learn more about JSON policy grammar, see Grammar of the IAM JSON policy language in the IAM User Guide. 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::ManagedPolicy for more information about the expected schema for this property.

    policyId String
    roles List<String>
    The name (friendly name, not ARN) of the role to attach the policy to. This parameter allows (per 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: _+=,.@- If an external policy (such as AWS::IAM::Policy or AWS::IAM::ManagedPolicy) has a Ref to a role and if a resource (such as AWS::ECS::Service) also has a Ref to the same role, add a DependsOn attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with an AWS::ECS::Service resource, the DependsOn attribute ensures that CFN deletes the AWS::ECS::Service resource before deleting its role's policy.
    updateDate String
    users List<String>
    The name (friendly name, not ARN) of the IAM user to attach the policy to. 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: _+=,.@-

    Package Details

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

    We recommend new projects start with resources from the AWS provider.

    AWS Cloud Control v1.9.0 published on Monday, Nov 18, 2024 by Pulumi