Skip to content

Commit

Permalink
Update AWS EC2 module and provider versions
Browse files Browse the repository at this point in the history
  • Loading branch information
IliyanKostov9 committed Feb 24, 2024
1 parent a7d4ae4 commit 7dc5b38
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Terraform_deploy_AWS_12_free_months
name: terraform_deploy_passbolt
#description: "Deploy Terraform After Infra"

on:
Expand All @@ -13,7 +13,8 @@ on:
description: |
App to be deployed on 12 months free.
options:
- passbolt1o
- passbolt
- vpn
required: true

jobs:
Expand All @@ -26,27 +27,27 @@ jobs:
pull-requests: write

env:
terraform_main_file_path: "terraform/apps/12_months_free/${{ inputs.app }}"
terraform_main_file_path: "./terraform/apps/12_months_free/${{ inputs.app }}"
terraform_var_common_file: "../../../envs/prod/common/env.tfvars"
terraform_var_app_file: "../../../envs/prod/app/12_months_free/${{ inputs.app }}/env.tfvars"
# Terraform secrets
TF_CLOUD_ORGANIZATION: ${{ secrets.TF_ORG }}
TF_API_TOKEN: ${{ secrets.TF_API_TOKEN }}
TF_WORKSPACE: "github-aws-account-creation-actions-workspace"
TF_WORKSPACE: "passbolt"
# runs:
# using: "composite"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# - name: Upload Configuration
# uses: hashicorp/tfc-workflows-github/actions/[email protected]
# id: plan-upload
# with:
# workspace: ${{ env.TF_WORKSPACE }}
# directory: ${{ env.terraform_main_file_path }}
# speculative: true
- name: Upload Configuration
uses: hashicorp/tfc-workflows-github/actions/[email protected]
id: plan-upload
with:
workspace: ${{ env.TF_WORKSPACE }}
directory: ${{ env.terraform_main_file_path }}
speculative: true

# Install the latest version of Terraform CLI
- name: Setup Terraform
Expand Down
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,21 @@ install-deps: ## install python deps

#################
#
# Run the TCs by product type
# Terraform
#
##################

.PHONY: test
test: set-marker set-opco ## run tests
$(eval PYTEST_PATH = src/tests/$(MARKER)/)
@echo "PYTEST_PATH = $(PYTEST_PATH)"
@echo "MARKER = $(MARKER)"
@echo "OPCO = ${OP_CO}"
${PYTHON} -m pytest '${PYTEST_PATH}' --alluredir=${allure_path} --junitxml=junitxml_report.xml --op_co ${OP_CO} -m ${MARKER} --clean_up_tables -v
allure serve ${allure_path}
.PHONY: tf-init
tf-init: ## run tf init
terraform -chdir="./terraform/apps/12_months_free/vpn" init

.PHONY: tf-plan
tf-plan: ## run tf plan
terraform -chdir="./terraform/apps/12_months_free/vpn" plan -var-file=../../../envs/prod/common/env.tfvars -var-file=../../../envs/prod/app/12_months_free/passbolt/env.tfvars

.PHONY: tf-apply
tf-apply: ## run tf apply
terraform -chdir="./terraform/apps/12_months_free/vpn" apply -var-file=../../../envs/prod/common/env.tfvars -var-file=../../../envs/prod/app/12_months_free/passbolt/env.tfvars


.PHONY: secret-scan
Expand Down
34 changes: 17 additions & 17 deletions terraform/apps/12_months_free/passbolt/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions terraform/apps/12_months_free/passbolt/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ terraform {
organization = "iliyangit-personal-tf-org"

workspaces {
name = "github-aws-account-creation-actions-workspace"
name = "passbolt"
}
}

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.16"
version = "5.38.0"
}
}

required_version = ">= 1.2.0"
required_version = ">= 1.7.3"
}

provider "aws" {
region = var.region

}

25 changes: 25 additions & 0 deletions terraform/apps/12_months_free/vpn/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion terraform/apps/12_months_free/vpn/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module "ec2_instance_passbolt" {

module "ec2_instance_vpn" {
source = "../../../modules/aws/ec2"
ec2_name = var.ec2_name
ec2_ami = var.ec2_ami
Expand Down
10 changes: 7 additions & 3 deletions terraform/apps/12_months_free/vpn/provider.tf
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
terraform {


cloud {
organization = "iliyangit-personal-tf-org"

workspaces {
name = "github-aws-account-creation-actions-workspace"
name = "vpn"
}
}

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.16"
version = "5.38.0"
}
}

required_version = ">= 1.2.0"
required_version = ">= 1.7.3"
}

provider "aws" {
region = var.region

}

2 changes: 1 addition & 1 deletion terraform/modules/aws/ec2/output.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "ec2_instance_passbolt" {
output "ec2_instance" {
value = aws_instance.app_server.arn
description = "EC2 instance ARN output to be referenced to other modules"

Expand Down
1 change: 1 addition & 0 deletions terraform/modules/aws/ec2/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ variable "ec2_name" {

}


variable "ec2_ami" {
description = "AMI ID on Ireland"
type = string
Expand Down

0 comments on commit 7dc5b38

Please sign in to comment.