0
Help us understand the problem. What are the problem?

posted at

updated at

複数リージョンのサービス使用時はMultiple Providerを使用する

複数のリージョンに分散するサービスを作成したい場合、Multiple Providerを使用すると便利です。

  • main.tf
provider "aws" {
  region  = "ap-northeast-1"
  profile = "terraform01"
}

// multiple provider
provider "aws" {
  region  = "us-east-1"
  alias   = "virginia"
  profile = "terraform02"
}
  • 例えば、globalaccelerator_accelerato.tf
resource "aws_globalaccelerator_accelerator" "select" {
  provider = aws.virginia
(snip)
  • 例えば、aws_wafv2_web_acl.tf
resource "aws_wafv2_web_acl" "select" {
  name        = "aws_wafv2_web_acl"
  scope       = "CLOUDFRONT"
  provider    = aws.virginia

  default_action {
    block {}
  }
(snip)
  • 例えば、data.aws_lambda_function
data "aws_lambda_function" "latest_lambda" {
  function_name = "latest"
  provider      = aws.virginia
(snip)
}
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
0
Help us understand the problem. What are the problem?