add config for ecr repo and remote backend
This commit is contained in:
9
terraform/ecr-repo.tf
Normal file
9
terraform/ecr-repo.tf
Normal file
@@ -0,0 +1,9 @@
|
||||
resource "aws_ecr_repository" "myapp-repo" {
|
||||
name = "myapp"
|
||||
|
||||
# defaults
|
||||
image_tag_mutability = "MUTABLE"
|
||||
image_scanning_configuration {
|
||||
scan_on_push = true
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "myapp-cluster-bucket"
|
||||
key = "myapp/state.tfstate"
|
||||
region = "eu-west-3"
|
||||
}
|
||||
}
|
||||
|
||||
provider "kubernetes" {
|
||||
load_config_file = "false"
|
||||
host = data.aws_eks_cluster.myapp-cluster.endpoint
|
||||
|
||||
7
terraform/outputs.tf
Normal file
7
terraform/outputs.tf
Normal file
@@ -0,0 +1,7 @@
|
||||
output repo_url {
|
||||
value = aws_ecr_repository.myapp-repo.repository_url
|
||||
}
|
||||
|
||||
output cluster_url {
|
||||
value = module.eks.cluster_endpoint
|
||||
}
|
||||
Reference in New Issue
Block a user