UNPKG

@pulumi/aws

Version:

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

120 lines 5.08 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.RepositoryPermissionsPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a CodeArtifact Repostory Permissions Policy Resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const exampleKey = new aws.kms.Key("example", {description: "domain key"}); * const exampleDomain = new aws.codeartifact.Domain("example", { * domain: "example", * encryptionKey: exampleKey.arn, * }); * const exampleRepository = new aws.codeartifact.Repository("example", { * repository: "example", * domain: exampleDomain.domain, * }); * const example = aws.iam.getPolicyDocumentOutput({ * statements: [{ * effect: "Allow", * principals: [{ * type: "*", * identifiers: ["*"], * }], * actions: ["codeartifact:ReadFromRepository"], * resources: [exampleRepository.arn], * }], * }); * const exampleRepositoryPermissionsPolicy = new aws.codeartifact.RepositoryPermissionsPolicy("example", { * repository: exampleRepository.repository, * domain: exampleDomain.domain, * policyDocument: example.apply(example => example.json), * }); * ``` * * ## Import * * ### Identity Schema * * #### Required * * - `arn` (String) Amazon Resource Name (ARN) of the CodeArtifact repository. * * Using `pulumi import`, import CodeArtifact Repository Permissions Policies using the CodeArtifact Repository ARN. For example: * * console * * % pulumi import aws_codeartifact_repository_permissions_policy.example arn:aws:codeartifact:us-west-2:012345678912:repository/tf-acc-test-6968272603913957763/tf-acc-test-6968272603913957763 */ class RepositoryPermissionsPolicy extends pulumi.CustomResource { /** * Get an existing RepositoryPermissionsPolicy 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 Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new RepositoryPermissionsPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of RepositoryPermissionsPolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === RepositoryPermissionsPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["domain"] = state?.domain; resourceInputs["domainOwner"] = state?.domainOwner; resourceInputs["policyDocument"] = state?.policyDocument; resourceInputs["policyRevision"] = state?.policyRevision; resourceInputs["region"] = state?.region; resourceInputs["repository"] = state?.repository; resourceInputs["resourceArn"] = state?.resourceArn; } else { const args = argsOrState; if (args?.domain === undefined && !opts.urn) { throw new Error("Missing required property 'domain'"); } if (args?.policyDocument === undefined && !opts.urn) { throw new Error("Missing required property 'policyDocument'"); } if (args?.repository === undefined && !opts.urn) { throw new Error("Missing required property 'repository'"); } resourceInputs["domain"] = args?.domain; resourceInputs["domainOwner"] = args?.domainOwner; resourceInputs["policyDocument"] = args?.policyDocument; resourceInputs["policyRevision"] = args?.policyRevision; resourceInputs["region"] = args?.region; resourceInputs["repository"] = args?.repository; resourceInputs["resourceArn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RepositoryPermissionsPolicy.__pulumiType, name, resourceInputs, opts); } } exports.RepositoryPermissionsPolicy = RepositoryPermissionsPolicy; /** @internal */ RepositoryPermissionsPolicy.__pulumiType = 'aws:codeartifact/repositoryPermissionsPolicy:RepositoryPermissionsPolicy'; //# sourceMappingURL=repositoryPermissionsPolicy.js.map