hahn

[Terraform] AWS provider 생성 본문

클라우드/Terraform

[Terraform] AWS provider 생성

hahn 2024. 8. 6. 03:53
728x90
반응형

Docs overview | hashicorp/aws | Terraform | Terraform Registry

 

Terraform Registry

 

registry.terraform.io

 

 

version을 선택한 후 우측 use provider을 클릭

 

 

복사 후 tf 파일에 붙여넣기

 

terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "5.61.0"
    }
  }
  
	required_version = ">= 1.4"
}

provider "aws" {
  # Configuration options
}

 

required_version = ">= 1.4" 을 설정하게 되는데 이는 공동 협업을 위함에 있음

 

terraform version에 따라 실행 방식이 상이하여 같은 코드라도 다른 결과가 나올 수 있기 때문

 

 

Version Constraints - Configuration Language | Terraform | HashiCorp Developer

 

Version Constraints - Configuration Language | Terraform | HashiCorp Developer

Version constraint strings specify a range of acceptable versions for modules, providers, and Terraform itself. Learn version constraint syntax and behavior.

developer.hashicorp.com

 

 

728x90
반응형

'클라우드 > Terraform' 카테고리의 다른 글

[Terraform] 변수 사용하기  (0) 2024.08.06
[Terraform] VPC 생성  (0) 2024.08.06
[Terraform] 참조  (0) 2024.08.06
[Terraform] helloworld 파일 생성  (0) 2024.08.06
[Terraform] 실행 준비, 적용, 삭제  (0) 2024.08.05