@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
113 lines • 4.42 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.Account = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a settings of an API Gateway Account. Settings is applied region-wide per `provider` block.
*
* > **Note:** By default, destroying this resource will keep your account settings intact. Set `resetOnDelete` to `true` to reset the account setttings to default. In a future major version of the provider, destroying the resource will reset account settings.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const assumeRole = aws.iam.getPolicyDocument({
* statements: [{
* effect: "Allow",
* principals: [{
* type: "Service",
* identifiers: ["apigateway.amazonaws.com"],
* }],
* actions: ["sts:AssumeRole"],
* }],
* });
* const cloudwatchRole = new aws.iam.Role("cloudwatch", {
* name: "api_gateway_cloudwatch_global",
* assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json),
* });
* const demo = new aws.apigateway.Account("demo", {cloudwatchRoleArn: cloudwatchRole.arn});
* const cloudwatch = aws.iam.getPolicyDocument({
* statements: [{
* effect: "Allow",
* actions: [
* "logs:CreateLogGroup",
* "logs:CreateLogStream",
* "logs:DescribeLogGroups",
* "logs:DescribeLogStreams",
* "logs:PutLogEvents",
* "logs:GetLogEvents",
* "logs:FilterLogEvents",
* ],
* resources: ["*"],
* }],
* });
* const cloudwatchRolePolicy = new aws.iam.RolePolicy("cloudwatch", {
* name: "default",
* role: cloudwatchRole.id,
* policy: cloudwatch.then(cloudwatch => cloudwatch.json),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import API Gateway Accounts using the account ID. For example:
*
* ```sh
* $ pulumi import aws:apigateway/account:Account demo 123456789012
* ```
*/
class Account extends pulumi.CustomResource {
/**
* Get an existing Account 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 Account(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Account. 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'] === Account.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["apiKeyVersion"] = state?.apiKeyVersion;
resourceInputs["cloudwatchRoleArn"] = state?.cloudwatchRoleArn;
resourceInputs["features"] = state?.features;
resourceInputs["region"] = state?.region;
resourceInputs["throttleSettings"] = state?.throttleSettings;
}
else {
const args = argsOrState;
resourceInputs["cloudwatchRoleArn"] = args?.cloudwatchRoleArn;
resourceInputs["region"] = args?.region;
resourceInputs["apiKeyVersion"] = undefined /*out*/;
resourceInputs["features"] = undefined /*out*/;
resourceInputs["throttleSettings"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Account.__pulumiType, name, resourceInputs, opts);
}
}
exports.Account = Account;
/** @internal */
Account.__pulumiType = 'aws:apigateway/account:Account';
//# sourceMappingURL=account.js.map
;