Package com.pulumi.aws.iam
Class GroupPolicyAttachment
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.iam.GroupPolicyAttachment
-
public class GroupPolicyAttachment extends com.pulumi.resources.CustomResourceAttaches a Managed IAM Policy to an IAM group > **NOTE:** The usage of this resource conflicts with the `aws.iam.PolicyAttachment` resource and will permanently show a difference if both are defined. ## Example Usage
## Import ### Identity Schema #### Required * `group` (String) Name of the IAM group. * `policyArn` (String) ARN of the IAM policy. #### Optional * `accountId` (String) AWS Account where this resource is managed. Using `pulumi import`, import IAM group policy attachments using the group name and policy ARN separated by `/`. For example: ```sh $ pulumi import aws:iam/groupPolicyAttachment:GroupPolicyAttachment test-attach test-group/arn:aws:iam::xxxxxxxxxxxx:policy/test-policy ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.iam.Group; import com.pulumi.aws.iam.GroupArgs; import com.pulumi.aws.iam.Policy; import com.pulumi.aws.iam.PolicyArgs; import com.pulumi.aws.iam.GroupPolicyAttachment; import com.pulumi.aws.iam.GroupPolicyAttachmentArgs; 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 group = new Group("group", GroupArgs.builder() .name("test-group") .build()); var policy = new Policy("policy", PolicyArgs.builder() .name("test-policy") .description("A test policy") .policy("{ ... policy JSON ... }") .build()); var test_attach = new GroupPolicyAttachment("test-attach", GroupPolicyAttachmentArgs.builder() .group(group.name()) .policyArn(policy.arn()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description GroupPolicyAttachment(java.lang.String name)GroupPolicyAttachment(java.lang.String name, GroupPolicyAttachmentArgs args)GroupPolicyAttachment(java.lang.String name, GroupPolicyAttachmentArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GroupPolicyAttachmentget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, GroupPolicyAttachmentState 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>group()com.pulumi.core.Output<java.lang.String>policyArn()
-
-
-
Constructor Detail
-
GroupPolicyAttachment
public GroupPolicyAttachment(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
GroupPolicyAttachment
public GroupPolicyAttachment(java.lang.String name, GroupPolicyAttachmentArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
GroupPolicyAttachment
public GroupPolicyAttachment(java.lang.String name, GroupPolicyAttachmentArgs 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
-
group
public com.pulumi.core.Output<java.lang.String> group()
- Returns:
- The group the policy should be applied to
-
policyArn
public com.pulumi.core.Output<java.lang.String> policyArn()
- Returns:
- The ARN of the policy you want to apply
-
get
public static GroupPolicyAttachment get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable GroupPolicyAttachmentState 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.
-
-