@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
141 lines • 5.41 kB
JavaScript
// *** 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.Repository = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a CodeArtifact Repository Resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kms.Key("example", {description: "domain key"});
* const exampleDomain = new aws.codeartifact.Domain("example", {
* domain: "example",
* encryptionKey: example.arn,
* });
* const test = new aws.codeartifact.Repository("test", {
* repository: "example",
* domain: exampleDomain.domain,
* });
* ```
*
* ### With Upstream Repository
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const upstream = new aws.codeartifact.Repository("upstream", {
* repository: "upstream",
* domain: testAwsCodeartifactDomain.domain,
* });
* const test = new aws.codeartifact.Repository("test", {
* repository: "example",
* domain: example.domain,
* upstreams: [{
* repositoryName: upstream.repository,
* }],
* });
* ```
*
* ### With External Connection
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const upstream = new aws.codeartifact.Repository("upstream", {
* repository: "upstream",
* domain: testAwsCodeartifactDomain.domain,
* });
* const test = new aws.codeartifact.Repository("test", {
* repository: "example",
* domain: example.domain,
* externalConnections: {
* externalConnectionName: "public:npmjs",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import CodeArtifact Repository using the CodeArtifact Repository ARN. For example:
*
* ```sh
* $ pulumi import aws:codeartifact/repository:Repository example arn:aws:codeartifact:us-west-2:012345678912:repository/tf-acc-test-6968272603913957763/tf-acc-test-6968272603913957763
* ```
*/
class Repository extends pulumi.CustomResource {
/**
* Get an existing Repository 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 Repository(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Repository. 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'] === Repository.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["administratorAccount"] = state?.administratorAccount;
resourceInputs["arn"] = state?.arn;
resourceInputs["description"] = state?.description;
resourceInputs["domain"] = state?.domain;
resourceInputs["domainOwner"] = state?.domainOwner;
resourceInputs["externalConnections"] = state?.externalConnections;
resourceInputs["region"] = state?.region;
resourceInputs["repository"] = state?.repository;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["upstreams"] = state?.upstreams;
}
else {
const args = argsOrState;
if (args?.domain === undefined && !opts.urn) {
throw new Error("Missing required property 'domain'");
}
if (args?.repository === undefined && !opts.urn) {
throw new Error("Missing required property 'repository'");
}
resourceInputs["description"] = args?.description;
resourceInputs["domain"] = args?.domain;
resourceInputs["domainOwner"] = args?.domainOwner;
resourceInputs["externalConnections"] = args?.externalConnections;
resourceInputs["region"] = args?.region;
resourceInputs["repository"] = args?.repository;
resourceInputs["tags"] = args?.tags;
resourceInputs["upstreams"] = args?.upstreams;
resourceInputs["administratorAccount"] = undefined /*out*/;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Repository.__pulumiType, name, resourceInputs, opts);
}
}
exports.Repository = Repository;
/** @internal */
Repository.__pulumiType = 'aws:codeartifact/repository:Repository';
//# sourceMappingURL=repository.js.map
;