UNPKG

@pulumi/aws

Version:

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

114 lines 5.28 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 * * 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 * ``` */ 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, Object.assign(Object.assign({}, 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 ? state.domain : undefined; resourceInputs["domainOwner"] = state ? state.domainOwner : undefined; resourceInputs["policyDocument"] = state ? state.policyDocument : undefined; resourceInputs["policyRevision"] = state ? state.policyRevision : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["repository"] = state ? state.repository : undefined; resourceInputs["resourceArn"] = state ? state.resourceArn : undefined; } else { const args = argsOrState; if ((!args || args.domain === undefined) && !opts.urn) { throw new Error("Missing required property 'domain'"); } if ((!args || args.policyDocument === undefined) && !opts.urn) { throw new Error("Missing required property 'policyDocument'"); } if ((!args || args.repository === undefined) && !opts.urn) { throw new Error("Missing required property 'repository'"); } resourceInputs["domain"] = args ? args.domain : undefined; resourceInputs["domainOwner"] = args ? args.domainOwner : undefined; resourceInputs["policyDocument"] = args ? args.policyDocument : undefined; resourceInputs["policyRevision"] = args ? args.policyRevision : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["repository"] = args ? args.repository : undefined; 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