Try AWS Native preview for resources not in the classic version.
aws.account.Region
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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,
});
import pulumi
import pulumi_aws as aws
example = aws.account.Region("example",
region_name="ap-southeast-3",
enabled=True)
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
})
}
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,
});
});
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());
}
}
resources:
example:
type: aws:account:Region
properties:
regionName: ap-southeast-3
enabled: true
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 string
- The unique name of the resource.
- args RegionArgs
- 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 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 string
- The unique name of the resource.
- args RegionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
example, err := account.NewRegion(ctx, "regionResource", &account.RegionArgs{
Enabled: pulumi.Bool(false),
RegionName: pulumi.String("string"),
AccountId: pulumi.String("string"),
})
var regionResource = new Region("regionResource", RegionArgs.builder()
.enabled(false)
.regionName("string")
.accountId("string")
.build());
region_resource = aws.account.Region("regionResource",
enabled=False,
region_name="string",
account_id="string")
const regionResource = new aws.account.Region("regionResource", {
enabled: false,
regionName: "string",
accountId: "string",
});
type: aws:account:Region
properties:
accountId: string
enabled: false
regionName: string
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
The Region resource accepts the following input properties:
- Enabled bool
- Whether the region is enabled.
- Region
Name string - The region name to manage.
- Account
Id 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.
- Region
Name string - The region name to manage.
- Account
Id 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.
- region
Name String - The region name to manage.
- account
Id 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.
- region
Name string - The region name to manage.
- account
Id 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.
- region_
name str - The region name to manage.
- account_
id 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 Boolean
- Whether the region is enabled.
- region
Name String - The region name to manage.
- account
Id 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 str
- The provider-assigned unique ID for this managed resource.
- opt_
status str - 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)
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.
- Account
Id 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.
- Opt
Status string - The region opt status.
- Region
Name string - The region name to manage.
- Account
Id 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.
- Opt
Status string - The region opt status.
- Region
Name string - The region name to manage.
- account
Id 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.
- opt
Status String - The region opt status.
- region
Name String - The region name to manage.
- account
Id 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.
- opt
Status string - The region opt status.
- region
Name string - The region name to manage.
- account_
id 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 str - The region name to manage.
- account
Id 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.
- opt
Status String - The region opt status.
- region
Name String - The region name to manage.
Import
Using pulumi import
. For example:
$ pulumi import aws:account/region:Region example ap-southeast-3
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.
Try AWS Native preview for resources not in the classic version.