AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.11.0 published on Wednesday, Aug 17, 2022 by Pulumi

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 System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var cloudwatchRole = new Aws.Iam.Role("cloudwatchRole", new()
    {
        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()
    {
        CloudwatchRoleArn = cloudwatchRole.Arn,
    });

    var cloudwatchRolePolicy = new Aws.Iam.RolePolicy("cloudwatchRolePolicy", new()
    {
        Role = cloudwatchRole.Id,
        Policy = @"{
    ""Version"": ""2012-10-17"",
    ""Statement"": [
        {
            ""Effect"": ""Allow"",
            ""Action"": [
                ""logs:CreateLogGroup"",
                ""logs:CreateLogStream"",
                ""logs:DescribeLogGroups"",
                ""logs:DescribeLogStreams"",
                ""logs:PutLogEvents"",
                ""logs:GetLogEvents"",
                ""logs:FilterLogEvents""
            ],
            ""Resource"": ""*""
        }
    ]
}
",
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/apigateway"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cloudwatchRole, err := iam.NewRole(ctx, "cloudwatchRole", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.Any(fmt.Sprintf(`{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "apigateway.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
`)),
		})
		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{
			Role: cloudwatchRole.ID(),
			Policy: pulumi.Any(fmt.Sprintf(`{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:DescribeLogGroups",
                "logs:DescribeLogStreams",
                "logs:PutLogEvents",
                "logs:GetLogEvents",
                "logs:FilterLogEvents"
            ],
            "Resource": "*"
        }
    ]
}
`)),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.apigateway.Account;
import com.pulumi.aws.apigateway.AccountArgs;
import com.pulumi.aws.iam.RolePolicy;
import com.pulumi.aws.iam.RolePolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var cloudwatchRole = new Role("cloudwatchRole", RoleArgs.builder()        
            .assumeRolePolicy("""
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "apigateway.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
            """)
            .build());

        var demo = new Account("demo", AccountArgs.builder()        
            .cloudwatchRoleArn(cloudwatchRole.arn())
            .build());

        var cloudwatchRolePolicy = new RolePolicy("cloudwatchRolePolicy", RolePolicyArgs.builder()        
            .role(cloudwatchRole.id())
            .policy("""
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:DescribeLogGroups",
                "logs:DescribeLogStreams",
                "logs:PutLogEvents",
                "logs:GetLogEvents",
                "logs:FilterLogEvents"
            ],
            "Resource": "*"
        }
    ]
}
            """)
            .build());

    }
}
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",
    role=cloudwatch_role.id,
    policy="""{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:DescribeLogGroups",
                "logs:DescribeLogStreams",
                "logs:PutLogEvents",
                "logs:GetLogEvents",
                "logs:FilterLogEvents"
            ],
            "Resource": "*"
        }
    ]
}
""")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const cloudwatchRole = new aws.iam.Role("cloudwatchRole", {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("cloudwatchRolePolicy", {
    role: cloudwatchRole.id,
    policy: `{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:DescribeLogGroups",
                "logs:DescribeLogStreams",
                "logs:PutLogEvents",
                "logs:GetLogEvents",
                "logs:FilterLogEvents"
            ],
            "Resource": "*"
        }
    ]
}
`,
});
resources:
  demo:
    type: aws:apigateway:Account
    properties:
      cloudwatchRoleArn: ${cloudwatchRole.arn}
  cloudwatchRole:
    type: aws:iam:Role
    properties:
      assumeRolePolicy: |
        {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Sid": "",
              "Effect": "Allow",
              "Principal": {
                "Service": "apigateway.amazonaws.com"
              },
              "Action": "sts:AssumeRole"
            }
          ]
        }        
  cloudwatchRolePolicy:
    type: aws:iam:RolePolicy
    properties:
      role: ${cloudwatchRole.id}
      policy: |
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Action": [
                        "logs:CreateLogGroup",
                        "logs:CreateLogStream",
                        "logs:DescribeLogGroups",
                        "logs:DescribeLogStreams",
                        "logs:PutLogEvents",
                        "logs:GetLogEvents",
                        "logs:FilterLogEvents"
                    ],
                    "Resource": "*"
                }
            ]
        }        

Create a Account Resource

new Account(name: string, args?: AccountArgs, opts?: CustomResourceOptions);
@overload
def Account(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            cloudwatch_role_arn: Optional[str] = None)
@overload
def Account(resource_name: str,
            args: Optional[AccountArgs] = None,
            opts: Optional[ResourceOptions] = None)
func NewAccount(ctx *Context, name string, args *AccountArgs, opts ...ResourceOption) (*Account, error)
public Account(string name, AccountArgs? args = null, CustomResourceOptions? opts = null)
public Account(String name, AccountArgs args)
public Account(String name, AccountArgs args, CustomResourceOptions options)
type: aws:apigateway:Account
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args AccountArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control 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.
name String
The unique name of the resource.
args AccountArgs
The arguments to resource properties.
options 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 Architecture and Concepts docs.

Inputs

The Account resource accepts the following input properties:

CloudwatchRoleArn string

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.

CloudwatchRoleArn string

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.

cloudwatchRoleArn String

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.

cloudwatchRoleArn string

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_arn str

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.

cloudwatchRoleArn String

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.

ThrottleSettings List<AccountThrottleSetting>

Account-Level throttle settings. See exported fields below.

Id string

The provider-assigned unique ID for this managed resource.

ThrottleSettings []AccountThrottleSetting

Account-Level throttle settings. See exported fields below.

id String

The provider-assigned unique ID for this managed resource.

throttleSettings List<AccountThrottleSetting>

Account-Level throttle settings. See exported fields below.

id string

The provider-assigned unique ID for this managed resource.

throttleSettings AccountThrottleSetting[]

Account-Level throttle settings. See exported fields below.

id str

The provider-assigned unique ID for this managed resource.

throttle_settings Sequence[AccountThrottleSetting]

Account-Level throttle settings. See exported fields below.

id String

The provider-assigned unique ID for this managed resource.

throttleSettings List<Property Map>

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): Account
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cloudwatch_role_arn: Optional[str] = None,
        throttle_settings: Optional[Sequence[AccountThrottleSettingArgs]] = None) -> Account
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)
public static Account get(String name, Output<String> id, AccountState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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:
CloudwatchRoleArn string

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.

ThrottleSettings List<AccountThrottleSettingArgs>

Account-Level throttle settings. See exported fields below.

CloudwatchRoleArn string

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.

ThrottleSettings []AccountThrottleSettingArgs

Account-Level throttle settings. See exported fields below.

cloudwatchRoleArn String

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.

throttleSettings List<AccountThrottleSettingArgs>

Account-Level throttle settings. See exported fields below.

cloudwatchRoleArn string

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.

throttleSettings AccountThrottleSettingArgs[]

Account-Level throttle settings. See exported fields below.

cloudwatch_role_arn str

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 Sequence[AccountThrottleSettingArgs]

Account-Level throttle settings. See exported fields below.

cloudwatchRoleArn String

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.

throttleSettings List<Property Map>

Account-Level throttle settings. See exported fields below.

Supporting Types

AccountThrottleSetting

BurstLimit int

The absolute maximum number of times API Gateway allows the API to be called per second (RPS).

RateLimit double

The number of times API Gateway allows the API to be called per second on average (RPS).

BurstLimit int

The absolute maximum number of times API Gateway allows the API to be called per second (RPS).

RateLimit float64

The number of times API Gateway allows the API to be called per second on average (RPS).

burstLimit Integer

The absolute maximum number of times API Gateway allows the API to be called per second (RPS).

rateLimit Double

The number of times API Gateway allows the API to be called per second on average (RPS).

burstLimit number

The absolute maximum number of times API Gateway allows the API to be called per second (RPS).

rateLimit number

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 float

The number of times API Gateway allows the API to be called per second on average (RPS).

burstLimit Number

The absolute maximum number of times API Gateway allows the API to be called per second (RPS).

rateLimit Number

The number of times API Gateway allows the API to be called per second on average (RPS).

Import

API Gateway Accounts can be imported using the word api-gateway-account, e.g.,

 $ pulumi import aws:apigateway/account:Account demo api-gateway-account

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.