Skip to content

Commit

Permalink
Merge pull request #83 from hackforla/iac/home-unite-us
Browse files Browse the repository at this point in the history
Home Unite Us DNS and OIDC action
  • Loading branch information
chelseybeck committed Aug 15, 2024
2 parents cf5494b + 65e08d0 commit cfbc0ec
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/terraform-plan-with-oidc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Terraform deploy with OIDC
on:
workflow_dispatch:
inputs:
target-host-environment:
type: choice
description: The AWS environment to deploy (dev/test/prod)
options:
- dev
- test
- prod

permissions:
id-token: write
contents: read

jobs:

TerraformPlan:

runs-on: ubuntu-latest

steps:
- name: Clone repo
uses: actions/checkout@v4

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::035866691871:role/gha-incubator
role-session-name: ghaincubatorsession
aws-region: us-west-2

- name:
uses: hashicorp/setup-terraform@v3

- name: Run terraform
run: |
pushd ./terraform-incubator/home-unite-us
terraform init
terraform plan
popd
30 changes: 30 additions & 0 deletions terraform-incubator/home-unite-us/dev/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resource "aws_route53_zone" "main" {
name = "homeunite.us"
}

resource "aws_route53_record" "www" {
zone_id = aws_route53_zone.main.zone_id
name = "homeunite.us"
type = "A"
ttl = 300
records = ["18.223.160.58"]
}

terraform {

required_providers {
aws = {
source = "hashicorp/aws"
}
}

backend "s3" {
region = "us-west-2"
key = "incubator/home-unite-us/dev.tfstate"
bucket = "hlfa-incubator-terragrunt"
}
}

provider "aws" {
region = "us-west-2"
}

0 comments on commit cfbc0ec

Please sign in to comment.