@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
101 lines • 4.1 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.DomainPermissions = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a CodeArtifact Domains Permissions Policy 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 = aws.iam.getPolicyDocumentOutput({
* statements: [{
* effect: "Allow",
* principals: [{
* type: "*",
* identifiers: ["*"],
* }],
* actions: ["codeartifact:CreateRepository"],
* resources: [exampleDomain.arn],
* }],
* });
* const testDomainPermissions = new aws.codeartifact.DomainPermissions("test", {
* domain: exampleDomain.domain,
* policyDocument: test.apply(test => test.json),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import CodeArtifact Domain Permissions Policies using the CodeArtifact Domain ARN. For example:
*
* ```sh
* $ pulumi import aws:codeartifact/domainPermissions:DomainPermissions example arn:aws:codeartifact:us-west-2:012345678912:domain/tf-acc-test-1928056699409417367
* ```
*/
class DomainPermissions extends pulumi.CustomResource {
/**
* Get an existing DomainPermissions 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 DomainPermissions(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DomainPermissions. 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'] === DomainPermissions.__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["resourceArn"] = state?.resourceArn;
}
else {
const args = argsOrState;
if (args?.domain === undefined && !opts.urn) {
throw new Error("Missing required property 'domain'");
}
resourceInputs["domain"] = args?.domain;
resourceInputs["domainOwner"] = args?.domainOwner;
resourceInputs["policyDocument"] = args?.policyDocument;
resourceInputs["policyRevision"] = args?.policyRevision;
resourceInputs["region"] = args?.region;
resourceInputs["resourceArn"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DomainPermissions.__pulumiType, name, resourceInputs, opts);
}
}
exports.DomainPermissions = DomainPermissions;
/** @internal */
DomainPermissions.__pulumiType = 'aws:codeartifact/domainPermissions:DomainPermissions';
//# sourceMappingURL=domainPermissions.js.map
;