terraform aws provider 생성
~/.aws/credentials 확인
$ vim ~/.aws/credentials
[terraformA]
aws_access_key_id = AWSACCESSKEYID
aws_secret_access_key = AWSSECRETACCESSKEY
~/.aws/config 확인
$ vim ~/.aws/config
[terraformA]
region = us-east-1
디렉토리 생성
$ mkdir -p terraformA/aws/serviceA/us-east-1
aws provider
provider.tf 파일 생성
$ vim provider.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.25.0"
}
}
}
provider "aws" {
# Configuration options
shared_credentials_file = "~/.aws/credentials"
region = "us-east-1"
profile = "terraformA"
}
terraform init 명령 실행
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Reusing previous version of hashicorp/aws from the dependency lock file
- Installing hashicorp/aws v3.25.0...
- Installed hashicorp/aws v3.25.0 (signed by HashiCorp)
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
참고URL
- https://registry.terraform.io/providers/hashicorp/aws/latest
- https://learn.hashicorp.com/tutorials/terraform/aws-remote?in=terraform/aws-get-started
'리눅스' 카테고리의 다른 글
[draft] Amazon S3로 Terraform 백엔드 구성하기 - terraform code (0) | 2025.10.19 |
---|---|
[draft] Amazon S3로 Terraform 백엔드 구성하기 (0) | 2025.10.19 |
[draft] terraform 명령어 (0) | 2025.10.19 |
[draft] 테라폼(Terraform) CLI를 설치하는 방법 (0) | 2025.10.19 |
[draft] PHP에 mecab-ko를 사용하여 한국어 형태소 분석을 수행하고 사용자 정의 사전을 추가하는 방법 (0) | 2025.10.18 |