New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
테라폼을 활용한 ElastiCache 프로비저닝 #14
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ku-kim
commented
Dec 8, 2022
Comment on lines
+24
to
+37
resource "aws_elasticache_cluster" "redis-terraform-test" { | ||
cluster_id = "redis-terraform-test" | ||
engine = "redis" | ||
node_type = "cache.t2.micro" | ||
num_cache_nodes = 1 # node 1개 | ||
parameter_group_name = "default.redis7" # 파라미터 그룹 | ||
engine_version = "7.0" # 레디스 버전 | ||
port = 6379 | ||
security_group_ids = [ | ||
aws_security_group.infra_test_redis_security_group.id | ||
] | ||
|
||
subnet_group_name = aws_elasticache_subnet_group.infra_test_vpc_subnet_group.name | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redis는 단일 노드로 생성하였고 프리티어 대상 t2.micro로 생성하였습니다.
ku-kim
commented
Dec 8, 2022
Comment on lines
+2
to
+10
resource "aws_iam_user" "infra-users" { | ||
count = length(var.users) | ||
name = element(var.users, count.index) | ||
path = "/infra/" | ||
|
||
tags = { | ||
Name = "infra-developers" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iam 생성은 필수가 아니지만 학습 목적으로 만들었습니다.
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
❗️ 이슈 번호
#13
📝 구현 내용
이 PR은 테라폼을 활용하여 ElastiCache를 프로비저닝 하는 예 입니다. (iam, vpc, subnet, security group, elasticache)
ElastiCache는 기본적으로 private subnet으로 외부 통신이 통제되며 같은 vpc ec2에서만 접근가능합니다.
ec2는 프로비저닝하지 않습니다.
ElastiCache 프로비저닝 (iam, VPC, subnet, security group, elasticache)
# infra/elasticache 디렉토리에 있다는 가정하에 terraform init terraform plan terraform apply
ec2에서 연결 확인
자원 제거
# infra/elasticache 디렉토리에 있다는 가정하에 terraform destroy
💡 참고 자료