@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
104 lines • 3.8 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.AuthPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS VPC Lattice Auth Policy.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.vpclattice.Service("example", {
* name: "example-vpclattice-service",
* authType: "AWS_IAM",
* customDomainName: "example.com",
* });
* const exampleAuthPolicy = new aws.vpclattice.AuthPolicy("example", {
* resourceIdentifier: example.arn,
* policy: JSON.stringify({
* Version: "2012-10-17",
* Statement: [{
* Action: "*",
* Effect: "Allow",
* Principal: "*",
* Resource: "*",
* Condition: {
* StringNotEqualsIgnoreCase: {
* "aws:PrincipalType": "anonymous",
* },
* },
* }],
* }),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import VPC Lattice Auth Policy using the `id`. For example:
*
* ```sh
* $ pulumi import aws:vpclattice/authPolicy:AuthPolicy example abcd-12345678
* ```
*/
class AuthPolicy extends pulumi.CustomResource {
/**
* Get an existing AuthPolicy 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 AuthPolicy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AuthPolicy. 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'] === AuthPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["policy"] = state?.policy;
resourceInputs["region"] = state?.region;
resourceInputs["resourceIdentifier"] = state?.resourceIdentifier;
resourceInputs["state"] = state?.state;
}
else {
const args = argsOrState;
if (args?.policy === undefined && !opts.urn) {
throw new Error("Missing required property 'policy'");
}
if (args?.resourceIdentifier === undefined && !opts.urn) {
throw new Error("Missing required property 'resourceIdentifier'");
}
resourceInputs["policy"] = args?.policy;
resourceInputs["region"] = args?.region;
resourceInputs["resourceIdentifier"] = args?.resourceIdentifier;
resourceInputs["state"] = args?.state;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AuthPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.AuthPolicy = AuthPolicy;
/** @internal */
AuthPolicy.__pulumiType = 'aws:vpclattice/authPolicy:AuthPolicy';
//# sourceMappingURL=authPolicy.js.map