All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.ssoadmin.CustomerManagedPolicyAttachment Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.ssoadmin;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.ssoadmin.CustomerManagedPolicyAttachmentArgs;
import com.pulumi.aws.ssoadmin.inputs.CustomerManagedPolicyAttachmentState;
import com.pulumi.aws.ssoadmin.outputs.CustomerManagedPolicyAttachmentCustomerManagedPolicyReference;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import javax.annotation.Nullable;

/**
 * Provides a customer managed policy attachment for a Single Sign-On (SSO) Permission Set resource
 * 
 * > **NOTE:** Creating this resource will automatically [Provision the Permission Set](https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ProvisionPermissionSet.html) to apply the corresponding updates to all assigned accounts.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.ssoadmin.SsoadminFunctions;
 * import com.pulumi.aws.ssoadmin.PermissionSet;
 * import com.pulumi.aws.ssoadmin.PermissionSetArgs;
 * import com.pulumi.aws.iam.Policy;
 * import com.pulumi.aws.iam.PolicyArgs;
 * import com.pulumi.aws.ssoadmin.CustomerManagedPolicyAttachment;
 * import com.pulumi.aws.ssoadmin.CustomerManagedPolicyAttachmentArgs;
 * import com.pulumi.aws.ssoadmin.inputs.CustomerManagedPolicyAttachmentCustomerManagedPolicyReferenceArgs;
 * import static com.pulumi.codegen.internal.Serialization.*;
 * import java.util.List;
 * import java.util.ArrayList;
 * 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) {
 *         final var example = SsoadminFunctions.getInstances();
 * 
 *         var examplePermissionSet = new PermissionSet("examplePermissionSet", PermissionSetArgs.builder()
 *             .name("Example")
 *             .instanceArn(example.applyValue(getInstancesResult -> getInstancesResult.arns()[0]))
 *             .build());
 * 
 *         var examplePolicy = new Policy("examplePolicy", PolicyArgs.builder()
 *             .name("TestPolicy")
 *             .description("My test policy")
 *             .policy(serializeJson(
 *                 jsonObject(
 *                     jsonProperty("Version", "2012-10-17"),
 *                     jsonProperty("Statement", jsonArray(jsonObject(
 *                         jsonProperty("Action", jsonArray("ec2:Describe*")),
 *                         jsonProperty("Effect", "Allow"),
 *                         jsonProperty("Resource", "*")
 *                     )))
 *                 )))
 *             .build());
 * 
 *         var exampleCustomerManagedPolicyAttachment = new CustomerManagedPolicyAttachment("exampleCustomerManagedPolicyAttachment", CustomerManagedPolicyAttachmentArgs.builder()
 *             .instanceArn(examplePermissionSet.instanceArn())
 *             .permissionSetArn(examplePermissionSet.arn())
 *             .customerManagedPolicyReference(CustomerManagedPolicyAttachmentCustomerManagedPolicyReferenceArgs.builder()
 *                 .name(examplePolicy.name())
 *                 .path("/")
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Using `pulumi import`, import SSO Managed Policy Attachments using the `name`, `path`, `permission_set_arn`, and `instance_arn` separated by a comma (`,`). For example: * * ```sh * $ pulumi import aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment example TestPolicy,/,arn:aws:sso:::permissionSet/ssoins-2938j0x8920sbj72/ps-80383020jr9302rk,arn:aws:sso:::instance/ssoins-2938j0x8920sbj72 * ``` * */ @ResourceType(type="aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment") public class CustomerManagedPolicyAttachment extends com.pulumi.resources.CustomResource { /** * Specifies the name and path of a customer managed policy. See below. * */ @Export(name="customerManagedPolicyReference", refs={CustomerManagedPolicyAttachmentCustomerManagedPolicyReference.class}, tree="[0]") private Output customerManagedPolicyReference; /** * @return Specifies the name and path of a customer managed policy. See below. * */ public Output customerManagedPolicyReference() { return this.customerManagedPolicyReference; } /** * The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed. * */ @Export(name="instanceArn", refs={String.class}, tree="[0]") private Output instanceArn; /** * @return The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed. * */ public Output instanceArn() { return this.instanceArn; } /** * The Amazon Resource Name (ARN) of the Permission Set. * */ @Export(name="permissionSetArn", refs={String.class}, tree="[0]") private Output permissionSetArn; /** * @return The Amazon Resource Name (ARN) of the Permission Set. * */ public Output permissionSetArn() { return this.permissionSetArn; } /** * * @param name The _unique_ name of the resulting resource. */ public CustomerManagedPolicyAttachment(java.lang.String name) { this(name, CustomerManagedPolicyAttachmentArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public CustomerManagedPolicyAttachment(java.lang.String name, CustomerManagedPolicyAttachmentArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public CustomerManagedPolicyAttachment(java.lang.String name, CustomerManagedPolicyAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private CustomerManagedPolicyAttachment(java.lang.String name, Output id, @Nullable CustomerManagedPolicyAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment", name, state, makeResourceOptions(options, id), false); } private static CustomerManagedPolicyAttachmentArgs makeArgs(CustomerManagedPolicyAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? CustomerManagedPolicyAttachmentArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static CustomerManagedPolicyAttachment get(java.lang.String name, Output id, @Nullable CustomerManagedPolicyAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new CustomerManagedPolicyAttachment(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy