@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
104 lines • 4.14 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.DomainServiceAccessPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an CloudSearch domain service access policy resource.
*
* The provider waits for the domain service access policy to become `Active` when applying a configuration.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleDomain = new aws.cloudsearch.Domain("example", {name: "example-domain"});
* const example = aws.iam.getPolicyDocument({
* statements: [{
* sid: "search_only",
* effect: "Allow",
* principals: [{
* type: "*",
* identifiers: ["*"],
* }],
* actions: [
* "cloudsearch:search",
* "cloudsearch:document",
* ],
* conditions: [{
* test: "IpAddress",
* variable: "aws:SourceIp",
* values: ["192.0.2.0/32"],
* }],
* }],
* });
* const exampleDomainServiceAccessPolicy = new aws.cloudsearch.DomainServiceAccessPolicy("example", {
* domainName: exampleDomain.id,
* accessPolicy: example.then(example => example.json),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import CloudSearch domain service access policies using the domain name. For example:
*
* ```sh
* $ pulumi import aws:cloudsearch/domainServiceAccessPolicy:DomainServiceAccessPolicy example example-domain
* ```
*/
class DomainServiceAccessPolicy extends pulumi.CustomResource {
/**
* Get an existing DomainServiceAccessPolicy 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 DomainServiceAccessPolicy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DomainServiceAccessPolicy. 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'] === DomainServiceAccessPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessPolicy"] = state?.accessPolicy;
resourceInputs["domainName"] = state?.domainName;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.accessPolicy === undefined && !opts.urn) {
throw new Error("Missing required property 'accessPolicy'");
}
if (args?.domainName === undefined && !opts.urn) {
throw new Error("Missing required property 'domainName'");
}
resourceInputs["accessPolicy"] = args?.accessPolicy;
resourceInputs["domainName"] = args?.domainName;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DomainServiceAccessPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.DomainServiceAccessPolicy = DomainServiceAccessPolicy;
/** @internal */
DomainServiceAccessPolicy.__pulumiType = 'aws:cloudsearch/domainServiceAccessPolicy:DomainServiceAccessPolicy';
//# sourceMappingURL=domainServiceAccessPolicy.js.map