@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
116 lines • 4.24 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.ResourceDataSync = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a SSM resource data sync.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const hogeBucket = new aws.s3.Bucket("hoge", {bucket: "tf-test-bucket-1234"});
* const hoge = aws.iam.getPolicyDocument({
* statements: [
* {
* sid: "SSMBucketPermissionsCheck",
* effect: "Allow",
* principals: [{
* type: "Service",
* identifiers: ["ssm.amazonaws.com"],
* }],
* actions: ["s3:GetBucketAcl"],
* resources: ["arn:aws:s3:::tf-test-bucket-1234"],
* },
* {
* sid: "SSMBucketDelivery",
* effect: "Allow",
* principals: [{
* type: "Service",
* identifiers: ["ssm.amazonaws.com"],
* }],
* actions: ["s3:PutObject"],
* resources: ["arn:aws:s3:::tf-test-bucket-1234/*"],
* conditions: [{
* test: "StringEquals",
* variable: "s3:x-amz-acl",
* values: ["bucket-owner-full-control"],
* }],
* },
* ],
* });
* const hogeBucketPolicy = new aws.s3.BucketPolicy("hoge", {
* bucket: hogeBucket.id,
* policy: hoge.then(hoge => hoge.json),
* });
* const foo = new aws.ssm.ResourceDataSync("foo", {
* name: "foo",
* s3Destination: {
* bucketName: hogeBucket.bucket,
* region: hogeBucket.region,
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import SSM resource data sync using the `name`. For example:
*
* ```sh
* $ pulumi import aws:ssm/resourceDataSync:ResourceDataSync example example-name
* ```
*/
class ResourceDataSync extends pulumi.CustomResource {
/**
* Get an existing ResourceDataSync 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 ResourceDataSync(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ResourceDataSync. 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'] === ResourceDataSync.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["s3Destination"] = state?.s3Destination;
}
else {
const args = argsOrState;
if (args?.s3Destination === undefined && !opts.urn) {
throw new Error("Missing required property 's3Destination'");
}
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["s3Destination"] = args?.s3Destination;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ResourceDataSync.__pulumiType, name, resourceInputs, opts);
}
}
exports.ResourceDataSync = ResourceDataSync;
/** @internal */
ResourceDataSync.__pulumiType = 'aws:ssm/resourceDataSync:ResourceDataSync';
//# sourceMappingURL=resourceDataSync.js.map
;