@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
79 lines • 3.36 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.SnapshotCreateVolumePermission = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Adds permission to create volumes off of a given EBS Snapshot.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ebs.Volume("example", {
* availabilityZone: "us-west-2a",
* size: 40,
* });
* const exampleSnapshot = new aws.ebs.Snapshot("example_snapshot", {volumeId: example.id});
* const examplePerm = new aws.ec2.SnapshotCreateVolumePermission("example_perm", {
* snapshotId: exampleSnapshot.id,
* accountId: "12345678",
* });
* ```
*/
class SnapshotCreateVolumePermission extends pulumi.CustomResource {
/**
* Get an existing SnapshotCreateVolumePermission 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 SnapshotCreateVolumePermission(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SnapshotCreateVolumePermission. 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'] === SnapshotCreateVolumePermission.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state?.accountId;
resourceInputs["region"] = state?.region;
resourceInputs["snapshotId"] = state?.snapshotId;
}
else {
const args = argsOrState;
if (args?.accountId === undefined && !opts.urn) {
throw new Error("Missing required property 'accountId'");
}
if (args?.snapshotId === undefined && !opts.urn) {
throw new Error("Missing required property 'snapshotId'");
}
resourceInputs["accountId"] = args?.accountId;
resourceInputs["region"] = args?.region;
resourceInputs["snapshotId"] = args?.snapshotId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SnapshotCreateVolumePermission.__pulumiType, name, resourceInputs, opts);
}
}
exports.SnapshotCreateVolumePermission = SnapshotCreateVolumePermission;
/** @internal */
SnapshotCreateVolumePermission.__pulumiType = 'aws:ec2/snapshotCreateVolumePermission:SnapshotCreateVolumePermission';
//# sourceMappingURL=snapshotCreateVolumePermission.js.map