1. Packages
  2. AWS Classic
  3. API Docs
  4. account
  5. Region

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi

aws.account.Region

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi

    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.

    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.
    RegionName string
    The region name to manage.
    AccountId 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.
    RegionName string
    The region name to manage.
    AccountId 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.
    regionName String
    The region name to manage.
    accountId 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.
    regionName string
    The region name to manage.
    accountId 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.
    regionName String
    The region name to manage.
    accountId 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)
    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:
    AccountId 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 string
    The region name to manage.
    AccountId 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 string
    The region name to manage.
    accountId 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 String
    The region name to manage.
    accountId 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 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.
    accountId 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 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.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi