1. Packages
  2. AWS
  3. API Docs
  4. account
  5. Region
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.account.Region

Explore with Pulumi AI

Enable (Opt-In) or Disable (Opt-Out) a particular Region for an AWS account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.account.Region("example", {
    regionName: "ap-southeast-3",
    enabled: true,
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.account.Region("example",
    region_name="ap-southeast-3",
    enabled=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/account"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := account.NewRegion(ctx, "example", &account.RegionArgs{
			RegionName: pulumi.String("ap-southeast-3"),
			Enabled:    pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Account.Region("example", new()
    {
        RegionName = "ap-southeast-3",
        Enabled = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.account.Region;
import com.pulumi.aws.account.RegionArgs;
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 example = new Region("example", RegionArgs.builder()
            .regionName("ap-southeast-3")
            .enabled(true)
            .build());

    }
}
Copy
resources:
  example:
    type: aws:account:Region
    properties:
      regionName: ap-southeast-3
      enabled: true
Copy

Create Region Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Region(name: string, args: RegionArgs, opts?: CustomResourceOptions);
@overload
def Region(resource_name: str,
           args: RegionArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def Region(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           enabled: Optional[bool] = None,
           region_name: Optional[str] = None,
           account_id: Optional[str] = None)
func NewRegion(ctx *Context, name string, args RegionArgs, opts ...ResourceOption) (*Region, error)
public Region(string name, RegionArgs args, CustomResourceOptions? opts = null)
public Region(String name, RegionArgs args)
public Region(String name, RegionArgs args, CustomResourceOptions options)
type: aws:account:Region
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RegionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RegionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RegionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RegionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RegionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var regionResource = new Aws.Account.Region("regionResource", new()
{
    Enabled = false,
    RegionName = "string",
    AccountId = "string",
});
Copy
example, err := account.NewRegion(ctx, "regionResource", &account.RegionArgs{
	Enabled:    pulumi.Bool(false),
	RegionName: pulumi.String("string"),
	AccountId:  pulumi.String("string"),
})
Copy
var regionResource = new Region("regionResource", RegionArgs.builder()
    .enabled(false)
    .regionName("string")
    .accountId("string")
    .build());
Copy
region_resource = aws.account.Region("regionResource",
    enabled=False,
    region_name="string",
    account_id="string")
Copy
const regionResource = new aws.account.Region("regionResource", {
    enabled: false,
    regionName: "string",
    accountId: "string",
});
Copy
type: aws:account:Region
properties:
    accountId: string
    enabled: false
    regionName: string
Copy

Region Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Region resource accepts the following input properties:

Enabled This property is required. bool
Whether the region is enabled.
RegionName
This property is required.
Changes to this property will trigger replacement.
string
The region name to manage.
AccountId Changes to this property will trigger replacement. string
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
Enabled This property is required. bool
Whether the region is enabled.
RegionName
This property is required.
Changes to this property will trigger replacement.
string
The region name to manage.
AccountId Changes to this property will trigger replacement. string
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
enabled This property is required. Boolean
Whether the region is enabled.
regionName
This property is required.
Changes to this property will trigger replacement.
String
The region name to manage.
accountId Changes to this property will trigger replacement. String
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
enabled This property is required. boolean
Whether the region is enabled.
regionName
This property is required.
Changes to this property will trigger replacement.
string
The region name to manage.
accountId Changes to this property will trigger replacement. string
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
enabled This property is required. bool
Whether the region is enabled.
region_name
This property is required.
Changes to this property will trigger replacement.
str
The region name to manage.
account_id Changes to this property will trigger replacement. str
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
enabled This property is required. Boolean
Whether the region is enabled.
regionName
This property is required.
Changes to this property will trigger replacement.
String
The region name to manage.
accountId Changes to this property will trigger replacement. String
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.

Outputs

All input properties are implicitly available as output properties. Additionally, the Region resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
OptStatus string
The region opt status.
Id string
The provider-assigned unique ID for this managed resource.
OptStatus string
The region opt status.
id String
The provider-assigned unique ID for this managed resource.
optStatus String
The region opt status.
id string
The provider-assigned unique ID for this managed resource.
optStatus string
The region opt status.
id str
The provider-assigned unique ID for this managed resource.
opt_status str
The region opt status.
id String
The provider-assigned unique ID for this managed resource.
optStatus String
The region opt status.

Look up Existing Region Resource

Get an existing Region 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?: RegionState, opts?: CustomResourceOptions): Region
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        enabled: Optional[bool] = None,
        opt_status: Optional[str] = None,
        region_name: Optional[str] = None) -> Region
func GetRegion(ctx *Context, name string, id IDInput, state *RegionState, opts ...ResourceOption) (*Region, error)
public static Region Get(string name, Input<string> id, RegionState? state, CustomResourceOptions? opts = null)
public static Region get(String name, Output<String> id, RegionState state, CustomResourceOptions options)
resources:  _:    type: aws:account:Region    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AccountId Changes to this property will trigger replacement. string
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
Enabled bool
Whether the region is enabled.
OptStatus string
The region opt status.
RegionName Changes to this property will trigger replacement. string
The region name to manage.
AccountId Changes to this property will trigger replacement. string
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
Enabled bool
Whether the region is enabled.
OptStatus string
The region opt status.
RegionName Changes to this property will trigger replacement. string
The region name to manage.
accountId Changes to this property will trigger replacement. String
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
enabled Boolean
Whether the region is enabled.
optStatus String
The region opt status.
regionName Changes to this property will trigger replacement. String
The region name to manage.
accountId Changes to this property will trigger replacement. string
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
enabled boolean
Whether the region is enabled.
optStatus string
The region opt status.
regionName Changes to this property will trigger replacement. string
The region name to manage.
account_id Changes to this property will trigger replacement. str
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
enabled bool
Whether the region is enabled.
opt_status str
The region opt status.
region_name Changes to this property will trigger replacement. str
The region name to manage.
accountId Changes to this property will trigger replacement. String
The ID of the target account when managing member accounts. Will manage current user's account by default if omitted. To use this parameter, the caller must be an identity in the organization's management account or a delegated administrator account. The specified account ID must also be a member account in the same organization. The organization must have all features enabled, and the organization must have trusted access enabled for the Account Management service, and optionally a delegated admin account assigned.
enabled Boolean
Whether the region is enabled.
optStatus String
The region opt status.
regionName Changes to this property will trigger replacement. String
The region name to manage.

Import

Using pulumi import. For example:

$ pulumi import aws:account/region:Region example ap-southeast-3
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.