Adds initial files]
This commit is contained in:
32
infra/ecr/main.tf
Normal file
32
infra/ecr/main.tf
Normal file
@@ -0,0 +1,32 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = "~> 6.27"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
provider "aws" {
|
||||
region = var.aws_region
|
||||
}
|
||||
|
||||
resource "aws_ecr_repository" "app" {
|
||||
name = var.repository_name
|
||||
image_tag_mutability = "MUTABLE" # or "IMMUTABLE"
|
||||
|
||||
image_scanning_configuration {
|
||||
scan_on_push = true
|
||||
}
|
||||
|
||||
encryption_configuration {
|
||||
encryption_type = "AES256" # or "KMS" for customer managed keys
|
||||
}
|
||||
|
||||
tags = {
|
||||
Name = var.repository_name
|
||||
Environment = var.environment
|
||||
ManagedBy = "Terraform"
|
||||
}
|
||||
}
|
||||
14
infra/ecr/outputs.tf
Normal file
14
infra/ecr/outputs.tf
Normal file
@@ -0,0 +1,14 @@
|
||||
output "repository_url" {
|
||||
description = "ECR repository URL"
|
||||
value = aws_ecr_repository.app.repository_url
|
||||
}
|
||||
|
||||
output "repository_arn" {
|
||||
description = "ECR repository ARN"
|
||||
value = aws_ecr_repository.app.arn
|
||||
}
|
||||
|
||||
output "repository_name" {
|
||||
description = "ECR repository name"
|
||||
value = aws_ecr_repository.app.name
|
||||
}
|
||||
75
infra/ecr/terraform.tfstate
Normal file
75
infra/ecr/terraform.tfstate
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "1.14.3",
|
||||
"serial": 6,
|
||||
"lineage": "b2b2331d-cf66-169e-d25b-38e0528505fc",
|
||||
"outputs": {
|
||||
"repository_arn": {
|
||||
"value": "arn:aws:ecr:us-east-2:232048051668:repository/upflux-doc-analyser",
|
||||
"type": "string"
|
||||
},
|
||||
"repository_name": {
|
||||
"value": "upflux-doc-analyser",
|
||||
"type": "string"
|
||||
},
|
||||
"repository_url": {
|
||||
"value": "232048051668.dkr.ecr.us-east-2.amazonaws.com/upflux-doc-analyser",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "aws_ecr_repository",
|
||||
"name": "app",
|
||||
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"arn": "arn:aws:ecr:us-east-2:232048051668:repository/upflux-doc-analyser",
|
||||
"encryption_configuration": [
|
||||
{
|
||||
"encryption_type": "AES256",
|
||||
"kms_key": ""
|
||||
}
|
||||
],
|
||||
"force_delete": null,
|
||||
"id": "upflux-doc-analyser",
|
||||
"image_scanning_configuration": [
|
||||
{
|
||||
"scan_on_push": true
|
||||
}
|
||||
],
|
||||
"image_tag_mutability": "MUTABLE",
|
||||
"image_tag_mutability_exclusion_filter": [],
|
||||
"name": "upflux-doc-analyser",
|
||||
"region": "us-east-2",
|
||||
"registry_id": "232048051668",
|
||||
"repository_url": "232048051668.dkr.ecr.us-east-2.amazonaws.com/upflux-doc-analyser",
|
||||
"tags": {
|
||||
"Environment": "dev",
|
||||
"ManagedBy": "Terraform",
|
||||
"Name": "upflux-doc-analyser"
|
||||
},
|
||||
"tags_all": {
|
||||
"Environment": "dev",
|
||||
"ManagedBy": "Terraform",
|
||||
"Name": "upflux-doc-analyser"
|
||||
},
|
||||
"timeouts": null
|
||||
},
|
||||
"sensitive_attributes": [],
|
||||
"identity_schema_version": 0,
|
||||
"identity": {
|
||||
"account_id": "232048051668",
|
||||
"name": "upflux-doc-analyser",
|
||||
"region": "us-east-2"
|
||||
},
|
||||
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjoxMjAwMDAwMDAwMDAwfX0="
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"check_results": null
|
||||
}
|
||||
3
infra/ecr/terraform.tfvars
Normal file
3
infra/ecr/terraform.tfvars
Normal file
@@ -0,0 +1,3 @@
|
||||
aws_region = "us-east-2"
|
||||
repository_name = "upflux-doc-analyser"
|
||||
environment = "dev"
|
||||
16
infra/ecr/variable.tf
Normal file
16
infra/ecr/variable.tf
Normal file
@@ -0,0 +1,16 @@
|
||||
variable "aws_region" {
|
||||
description = "AWS region"
|
||||
type = string
|
||||
default = "us-east-1"
|
||||
}
|
||||
|
||||
variable "repository_name" {
|
||||
description = "Name of the ECR repository"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "environment" {
|
||||
description = "Environment name"
|
||||
type = string
|
||||
default = "dev"
|
||||
}
|
||||
Reference in New Issue
Block a user