Skip to content

Commit

Permalink
feat: update tf.checks step name and tf and aws version
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Jan 9, 2024
1 parent dee397c commit 5ddf60b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
6 changes: 3 additions & 3 deletions _example/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
output "name" {
value = module.amplify.*.name
value = module.amplify[*].name
description = "Amplify App name"

}

output "arn" {
value = module.amplify.*.arn
value = module.amplify[*].arn
description = "Amplify App ARN "

}

output "default_domain" {
value = module.amplify.*.default_domain
value = module.amplify[*].default_domain
description = "Amplify App domain (non-custom)"

}
20 changes: 8 additions & 12 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
locals {
environments = { for k, v in var.branches : k => v if var.amplify_enabled }
}

module "labels" {
source = "clouddrove/labels/aws"
version = "1.3.0"
Expand Down Expand Up @@ -66,7 +62,7 @@ resource "aws_amplify_app" "example" {
resource "aws_amplify_backend_environment" "example" {
count = var.amplify_enabled && var.backend_enable ? 1 : 0

app_id = join("", aws_amplify_app.example.*.id)
app_id = join("", aws_amplify_app.example[*].id)
environment_name = var.environment_name
deployment_artifacts = var.deployment_artifacts
stack_name = var.stack_name
Expand All @@ -75,7 +71,7 @@ resource "aws_amplify_backend_environment" "example" {
resource "aws_amplify_branch" "main" {
count = var.amplify_enabled ? 1 : 0

app_id = join("", aws_amplify_app.example.*.id)
app_id = join("", aws_amplify_app.example[*].id)
branch_name = var.branches.branch_name
display_name = var.branches.display_name
description = var.branches.description
Expand All @@ -92,28 +88,28 @@ resource "aws_amplify_domain_association" "example" {
count = var.amplify_enabled ? length(var.domain_name) : 0


app_id = join("", aws_amplify_app.example.*.id)
app_id = join("", aws_amplify_app.example[*].id)
domain_name = element(var.domain_name, count.index)
wait_for_verification = false

# https://example.com
sub_domain {
branch_name = join("", aws_amplify_branch.main.*.branch_name)
branch_name = join("", aws_amplify_branch.main[*].branch_name)
prefix = var.sub_domain_prefix_name
}

# https://www.example.com
sub_domain {
branch_name = join("", aws_amplify_branch.main.*.branch_name)
branch_name = join("", aws_amplify_branch.main[*].branch_name)
prefix = var.sub_domain_prefix_name
}
}

resource "aws_amplify_webhook" "master" {
count = var.amplify_enabled ? 1 : 0

app_id = join("", aws_amplify_app.example.*.id)
branch_name = join("", aws_amplify_branch.main.*.branch_name)
app_id = join("", aws_amplify_app.example[*].id)
branch_name = join("", aws_amplify_branch.main[*].branch_name)
description = "triggermaster"

}
}
6 changes: 3 additions & 3 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
output "name" {
description = "Amplify App name"
value = join("", aws_amplify_app.example.*.name)
value = join("", aws_amplify_app.example[*].name)
}

output "arn" {
description = "Amplify App ARN "
value = join("", aws_amplify_app.example.*.arn)
value = join("", aws_amplify_app.example[*].arn)
}

output "default_domain" {
description = "Amplify App domain (non-custom)"
value = join("", aws_amplify_app.example.*.default_domain)
value = join("", aws_amplify_app.example[*].default_domain)
}
7 changes: 1 addition & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ variable "stack_name" {
default = "amplify-app-example"
description = "AWS CloudFormation stack name of a backend environment."
}
variable "ttl" {
type = number
default = null
description = "Content Time To Live (TTL) for the website in seconds."
}

variable "custom_rules" {
type = list(object({
Expand Down Expand Up @@ -194,4 +189,4 @@ variable "branches" {
environment_variables = optional(map(string))
})
nullable = false
}
}

0 comments on commit 5ddf60b

Please sign in to comment.