3
0

More than 3 years have passed since last update.

TerraformでAWS 大阪リージョンを使う設定

Last updated at Posted at 2021-03-08

現状

これを書いている2021年3月8日現在、本家からは大阪リージョンに対応したAWSプロバイダーがリリースされています。
aws-provider no support for ap-northeast-3 region that became generally available on 1/03/21 #17882

This has been released in version 3.31.0 of the Terraform AWS provider. 
Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

(これは、TerraformAWSプロバイダーのバージョン3.31.0でリリースされています。
プロバイダーのバージョン管理に関するTerraformのドキュメントを参照するか、アップグレードについてサポートが必要な場合はお問い合わせください。
この機能に関するその他の機能リクエストまたはバグレポートについては、トリアージのテンプレートに従って新しいGitHubの問題を作成してください。
ありがとう!)

というわけで、AWSプロバイダーのバージョンを3.31.0以上にアップグレードすればいいです。

設定

provider "aws" {
  region = "ap-northeast-3"
}

terraform {
  required_providers {
    aws = "3.31.0"
  }
}

バックエンドにS3を使用している場合は、S3バックエンドのバリデーションで引っかかるので、 skip_region_validation = true が必要になります。

provider "aws" {
  region = "ap-northeast-3"
}

terraform {
  backend "s3" {
    bucket = "xxxxxxxxxxxx"
    key = "xxxxxxxxxxx"
    dynamodb_table = "xxxxxxxxxx"
    region = "ap-northeast-3"
    skip_region_validation = true
  }
  required_providers {
    aws = "3.31.0"
  }
}

上記内容で設定した後

$ terraform init

で、使えるようになるはずです。
メモとして書いたけど、そのうち必要なくなる内容ですね。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0