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

com.pulumi.aws.codeartifact.RepositoryPermissionsPolicy Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

The newest version!
// *** 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.codeartifact;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.codeartifact.RepositoryPermissionsPolicyArgs;
import com.pulumi.aws.codeartifact.inputs.RepositoryPermissionsPolicyState;
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 CodeArtifact Repostory Permissions Policy Resource.
 * 
 * ## 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.kms.Key;
 * import com.pulumi.aws.kms.KeyArgs;
 * import com.pulumi.aws.codeartifact.Domain;
 * import com.pulumi.aws.codeartifact.DomainArgs;
 * import com.pulumi.aws.codeartifact.Repository;
 * import com.pulumi.aws.codeartifact.RepositoryArgs;
 * import com.pulumi.aws.iam.IamFunctions;
 * import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
 * import com.pulumi.aws.codeartifact.RepositoryPermissionsPolicy;
 * import com.pulumi.aws.codeartifact.RepositoryPermissionsPolicyArgs;
 * 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) {
 *         var exampleKey = new Key("exampleKey", KeyArgs.builder()
 *             .description("domain key")
 *             .build());
 * 
 *         var exampleDomain = new Domain("exampleDomain", DomainArgs.builder()
 *             .domain("example")
 *             .encryptionKey(exampleKey.arn())
 *             .build());
 * 
 *         var exampleRepository = new Repository("exampleRepository", RepositoryArgs.builder()
 *             .repository("example")
 *             .domain(exampleDomain.domain())
 *             .build());
 * 
 *         final var example = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
 *             .statements(GetPolicyDocumentStatementArgs.builder()
 *                 .effect("Allow")
 *                 .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
 *                     .type("*")
 *                     .identifiers("*")
 *                     .build())
 *                 .actions("codeartifact:ReadFromRepository")
 *                 .resources(exampleRepository.arn())
 *                 .build())
 *             .build());
 * 
 *         var exampleRepositoryPermissionsPolicy = new RepositoryPermissionsPolicy("exampleRepositoryPermissionsPolicy", RepositoryPermissionsPolicyArgs.builder()
 *             .repository(exampleRepository.repository())
 *             .domain(exampleDomain.domain())
 *             .policyDocument(example.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult).applyValue(example -> example.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Using `pulumi import`, import CodeArtifact Repository Permissions Policies using the CodeArtifact Repository ARN. For example: * * ```sh * $ pulumi import aws:codeartifact/repositoryPermissionsPolicy:RepositoryPermissionsPolicy example arn:aws:codeartifact:us-west-2:012345678912:repository/tf-acc-test-6968272603913957763/tf-acc-test-6968272603913957763 * ``` * */ @ResourceType(type="aws:codeartifact/repositoryPermissionsPolicy:RepositoryPermissionsPolicy") public class RepositoryPermissionsPolicy extends com.pulumi.resources.CustomResource { /** * The name of the domain on which to set the resource policy. * */ @Export(name="domain", refs={String.class}, tree="[0]") private Output domain; /** * @return The name of the domain on which to set the resource policy. * */ public Output domain() { return this.domain; } /** * The account number of the AWS account that owns the domain. * */ @Export(name="domainOwner", refs={String.class}, tree="[0]") private Output domainOwner; /** * @return The account number of the AWS account that owns the domain. * */ public Output domainOwner() { return this.domainOwner; } /** * A JSON policy string to be set as the access control resource policy on the provided domain. * */ @Export(name="policyDocument", refs={String.class}, tree="[0]") private Output policyDocument; /** * @return A JSON policy string to be set as the access control resource policy on the provided domain. * */ public Output policyDocument() { return this.policyDocument; } /** * The current revision of the resource policy to be set. This revision is used for optimistic locking, which prevents others from overwriting your changes to the domain's resource policy. * */ @Export(name="policyRevision", refs={String.class}, tree="[0]") private Output policyRevision; /** * @return The current revision of the resource policy to be set. This revision is used for optimistic locking, which prevents others from overwriting your changes to the domain's resource policy. * */ public Output policyRevision() { return this.policyRevision; } /** * The name of the repository to set the resource policy on. * */ @Export(name="repository", refs={String.class}, tree="[0]") private Output repository; /** * @return The name of the repository to set the resource policy on. * */ public Output repository() { return this.repository; } /** * The ARN of the resource associated with the resource policy. * */ @Export(name="resourceArn", refs={String.class}, tree="[0]") private Output resourceArn; /** * @return The ARN of the resource associated with the resource policy. * */ public Output resourceArn() { return this.resourceArn; } /** * * @param name The _unique_ name of the resulting resource. */ public RepositoryPermissionsPolicy(java.lang.String name) { this(name, RepositoryPermissionsPolicyArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public RepositoryPermissionsPolicy(java.lang.String name, RepositoryPermissionsPolicyArgs 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 RepositoryPermissionsPolicy(java.lang.String name, RepositoryPermissionsPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:codeartifact/repositoryPermissionsPolicy:RepositoryPermissionsPolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private RepositoryPermissionsPolicy(java.lang.String name, Output id, @Nullable RepositoryPermissionsPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:codeartifact/repositoryPermissionsPolicy:RepositoryPermissionsPolicy", name, state, makeResourceOptions(options, id), false); } private static RepositoryPermissionsPolicyArgs makeArgs(RepositoryPermissionsPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? RepositoryPermissionsPolicyArgs.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 RepositoryPermissionsPolicy get(java.lang.String name, Output id, @Nullable RepositoryPermissionsPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new RepositoryPermissionsPolicy(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy