Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home Unite Us DNS and OIDC action #83

Merged
merged 4 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
Loading