Account
Provides a settings of an API Gateway Account. Settings is applied region-wide per provider block.
Note: As there is no API method for deleting account settings or resetting it to defaults, destroying this resource will keep your account settings intact
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var cloudwatchRole = new Aws.Iam.Role("cloudwatchRole", new Aws.Iam.RoleArgs
{
AssumeRolePolicy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
""Sid"": """",
""Effect"": ""Allow"",
""Principal"": {
""Service"": ""apigateway.amazonaws.com""
},
""Action"": ""sts:AssumeRole""
}
]
}
",
});
var demo = new Aws.ApiGateway.Account("demo", new Aws.ApiGateway.AccountArgs
{
CloudwatchRoleArn = cloudwatchRole.Arn,
});
var cloudwatchRolePolicy = new Aws.Iam.RolePolicy("cloudwatchRolePolicy", new Aws.Iam.RolePolicyArgs
{
Policy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
""Effect"": ""Allow"",
""Action"": [
""logs:CreateLogGroup"",
""logs:CreateLogStream"",
""logs:DescribeLogGroups"",
""logs:DescribeLogStreams"",
""logs:PutLogEvents"",
""logs:GetLogEvents"",
""logs:FilterLogEvents""
],
""Resource"": ""*""
}
]
}
",
Role = cloudwatchRole.Id,
});
}
}
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/apigateway"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cloudwatchRole, err := iam.NewRole(ctx, "cloudwatchRole", &iam.RoleArgs{
AssumeRolePolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", " \"Version\": \"2012-10-17\",\n", " \"Statement\": [\n", " {\n", " \"Sid\": \"\",\n", " \"Effect\": \"Allow\",\n", " \"Principal\": {\n", " \"Service\": \"apigateway.amazonaws.com\"\n", " },\n", " \"Action\": \"sts:AssumeRole\"\n", " }\n", " ]\n", "}\n", "\n")),
})
if err != nil {
return err
}
_, err = apigateway.NewAccount(ctx, "demo", &apigateway.AccountArgs{
CloudwatchRoleArn: cloudwatchRole.Arn,
})
if err != nil {
return err
}
_, err = iam.NewRolePolicy(ctx, "cloudwatchRolePolicy", &iam.RolePolicyArgs{
Policy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", " \"Version\": \"2012-10-17\",\n", " \"Statement\": [\n", " {\n", " \"Effect\": \"Allow\",\n", " \"Action\": [\n", " \"logs:CreateLogGroup\",\n", " \"logs:CreateLogStream\",\n", " \"logs:DescribeLogGroups\",\n", " \"logs:DescribeLogStreams\",\n", " \"logs:PutLogEvents\",\n", " \"logs:GetLogEvents\",\n", " \"logs:FilterLogEvents\"\n", " ],\n", " \"Resource\": \"*\"\n", " }\n", " ]\n", "}\n", "\n")),
Role: cloudwatchRole.ID(),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
cloudwatch_role = aws.iam.Role("cloudwatchRole", assume_role_policy="""{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "apigateway.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
""")
demo = aws.apigateway.Account("demo", cloudwatch_role_arn=cloudwatch_role.arn)
cloudwatch_role_policy = aws.iam.RolePolicy("cloudwatchRolePolicy",
policy="""{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:DescribeLogGroups",
"logs:DescribeLogStreams",
"logs:PutLogEvents",
"logs:GetLogEvents",
"logs:FilterLogEvents"
],
"Resource": "*"
}
]
}
""",
role=cloudwatch_role.id)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const cloudwatchRole = new aws.iam.Role("cloudwatch", {
assumeRolePolicy: `{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "apigateway.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
`,
});
const demo = new aws.apigateway.Account("demo", {
cloudwatchRoleArn: cloudwatchRole.arn,
});
const cloudwatchRolePolicy = new aws.iam.RolePolicy("cloudwatch", {
policy: `{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:DescribeLogGroups",
"logs:DescribeLogStreams",
"logs:PutLogEvents",
"logs:GetLogEvents",
"logs:FilterLogEvents"
],
"Resource": "*"
}
]
}
`,
role: cloudwatchRole.id,
});Create a Account Resource
new Account(name: string, args?: AccountArgs, opts?: CustomResourceOptions);def Account(resource_name, opts=None, cloudwatch_role_arn=None, __props__=None);func NewAccount(ctx *Context, name string, args *AccountArgs, opts ...ResourceOption) (*Account, error)public Account(string name, AccountArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args AccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AccountArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Account Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Account resource accepts the following input properties:
- Cloudwatch
Role stringArn The ARN of an IAM role for CloudWatch (to allow logging & monitoring). See more in AWS Docs. Logging & monitoring can be enabled/disabled and otherwise tuned on the API Gateway Stage level.
- Cloudwatch
Role stringArn The ARN of an IAM role for CloudWatch (to allow logging & monitoring). See more in AWS Docs. Logging & monitoring can be enabled/disabled and otherwise tuned on the API Gateway Stage level.
- cloudwatch
Role stringArn The ARN of an IAM role for CloudWatch (to allow logging & monitoring). See more in AWS Docs. Logging & monitoring can be enabled/disabled and otherwise tuned on the API Gateway Stage level.
- cloudwatch_
role_ strarn The ARN of an IAM role for CloudWatch (to allow logging & monitoring). See more in AWS Docs. Logging & monitoring can be enabled/disabled and otherwise tuned on the API Gateway Stage level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Account resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Throttle
Settings AccountThrottle Settings Account-Level throttle settings. See exported fields below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Throttle
Settings AccountThrottle Settings Account-Level throttle settings. See exported fields below.
- id string
- The provider-assigned unique ID for this managed resource.
- throttle
Settings AccountThrottle Settings Account-Level throttle settings. See exported fields below.
- id str
- The provider-assigned unique ID for this managed resource.
- throttle_
settings Dict[AccountThrottle Settings] Account-Level throttle settings. See exported fields below.
Look up an Existing Account Resource
Get an existing Account resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AccountState, opts?: CustomResourceOptions): Accountstatic get(resource_name, id, opts=None, cloudwatch_role_arn=None, throttle_settings=None, __props__=None);func GetAccount(ctx *Context, name string, id IDInput, state *AccountState, opts ...ResourceOption) (*Account, error)public static Account Get(string name, Input<string> id, AccountState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Cloudwatch
Role stringArn The ARN of an IAM role for CloudWatch (to allow logging & monitoring). See more in AWS Docs. Logging & monitoring can be enabled/disabled and otherwise tuned on the API Gateway Stage level.
- Throttle
Settings AccountThrottle Settings Args Account-Level throttle settings. See exported fields below.
- Cloudwatch
Role stringArn The ARN of an IAM role for CloudWatch (to allow logging & monitoring). See more in AWS Docs. Logging & monitoring can be enabled/disabled and otherwise tuned on the API Gateway Stage level.
- Throttle
Settings AccountThrottle Settings Account-Level throttle settings. See exported fields below.
- cloudwatch
Role stringArn The ARN of an IAM role for CloudWatch (to allow logging & monitoring). See more in AWS Docs. Logging & monitoring can be enabled/disabled and otherwise tuned on the API Gateway Stage level.
- throttle
Settings AccountThrottle Settings Account-Level throttle settings. See exported fields below.
- cloudwatch_
role_ strarn The ARN of an IAM role for CloudWatch (to allow logging & monitoring). See more in AWS Docs. Logging & monitoring can be enabled/disabled and otherwise tuned on the API Gateway Stage level.
- throttle_
settings Dict[AccountThrottle Settings] Account-Level throttle settings. See exported fields below.
Supporting Types
AccountThrottleSettings
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Burst
Limit int The absolute maximum number of times API Gateway allows the API to be called per second (RPS).
- Rate
Limit double The number of times API Gateway allows the API to be called per second on average (RPS).
- Burst
Limit int The absolute maximum number of times API Gateway allows the API to be called per second (RPS).
- Rate
Limit float64 The number of times API Gateway allows the API to be called per second on average (RPS).
- burst
Limit number The absolute maximum number of times API Gateway allows the API to be called per second (RPS).
- rate
Limit number The number of times API Gateway allows the API to be called per second on average (RPS).
- burst
Limit float The absolute maximum number of times API Gateway allows the API to be called per second (RPS).
- rate_
limit float The number of times API Gateway allows the API to be called per second on average (RPS).
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.