Class GroupPolicyAttachmentsExclusive


  • public class GroupPolicyAttachmentsExclusive
    extends com.pulumi.resources.CustomResource
    Resource for maintaining exclusive management of managed IAM policies assigned to an AWS IAM (Identity & Access Management) group. > This resource takes exclusive ownership over managed IAM policies attached to a group. This includes removal of managed IAM policies which are not explicitly configured. To prevent persistent drift, ensure any `aws.iam.GroupPolicyAttachment` resources managed alongside this resource are included in the `policyArns` argument. > Destruction of this resource means Terraform will no longer manage reconciliation of the configured policy attachments. It **will not** detach the configured policies from the group. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.iam.GroupPolicyAttachmentsExclusive;
     import com.pulumi.aws.iam.GroupPolicyAttachmentsExclusiveArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new GroupPolicyAttachmentsExclusive("example", GroupPolicyAttachmentsExclusiveArgs.builder()
                 .groupName(exampleAwsIamGroup.name())
                 .policyArns(exampleAwsIamPolicy.arn())
                 .build());
     
         }
     }
     
     
    ### Disallow Managed IAM Policies To automatically remove any configured managed IAM policies, set the `policyArns` argument to an empty list. > This will not **prevent** managed IAM policies from being assigned to a group via Terraform (or any other interface). This resource enables bringing managed IAM policy assignments into a configured state, however, this reconciliation happens only when `apply` is proactively run.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.iam.GroupPolicyAttachmentsExclusive;
     import com.pulumi.aws.iam.GroupPolicyAttachmentsExclusiveArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new GroupPolicyAttachmentsExclusive("example", GroupPolicyAttachmentsExclusiveArgs.builder()
                 .groupName(exampleAwsIamGroup.name())
                 .policyArns()
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import exclusive management of managed IAM policy assignments using the `groupName`. For example: ```sh $ pulumi import aws:iam/groupPolicyAttachmentsExclusive:GroupPolicyAttachmentsExclusive example MyGroup ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static GroupPolicyAttachmentsExclusive get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, GroupPolicyAttachmentsExclusiveState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> groupName()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> policyArns()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GroupPolicyAttachmentsExclusive

        public GroupPolicyAttachmentsExclusive​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • GroupPolicyAttachmentsExclusive

        public GroupPolicyAttachmentsExclusive​(java.lang.String name,
                                               GroupPolicyAttachmentsExclusiveArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • GroupPolicyAttachmentsExclusive

        public GroupPolicyAttachmentsExclusive​(java.lang.String name,
                                               GroupPolicyAttachmentsExclusiveArgs args,
                                               @Nullable
                                               com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • groupName

        public com.pulumi.core.Output<java.lang.String> groupName()
        Returns:
        IAM group name.
      • policyArns

        public com.pulumi.core.Output<java.util.List<java.lang.String>> policyArns()
        Returns:
        A list of managed IAM policy ARNs to be attached to the group. Policies attached to this group but not configured in this argument will be removed.
      • get

        public static GroupPolicyAttachmentsExclusive get​(java.lang.String name,
                                                          com.pulumi.core.Output<java.lang.String> id,
                                                          @Nullable
                                                          GroupPolicyAttachmentsExclusiveState state,
                                                          @Nullable
                                                          com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.