Skip to content
Closed
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
65 changes: 65 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: OIDC Test
on:
push:
workflow_dispatch:

permissions:
id-token: write

jobs:
access-s3:
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-northeast-2
role-to-assume: arn:aws:iam::433331841346:role/cloudfencedemorole

- name: List files in S3 bucket
run: aws s3 ls cloudfence-bucket
terraform:
name: "Security Check, and Deploy"
runs-on: ubuntu-latest

env:
AWS_REGION: "ap-northeast-2"
TF_VERSION: "1.4.0"
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-northeast-2
role-to-assume: arn:aws:iam::433331841346:role/cloudfencedemorole

- name: "Checkout GitHub repository"
uses: actions/checkout@v3

# terraform 설치 및 초기화
- name: "Set up Terraform"
uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ env.TF_VERSION }}
# trivy 설치 밀 실행
- name: Run Trivy IaC Scan
uses: aquasecurity/trivy-action@master
with:
scan-type: config
scan-ref: .

- name: "Terraform Init"
run: terraform init

- name: "Terraform Format"
run: terraform fmt

- name: "Terraform Validate"
run: terraform validate

- name: "Terraform Plan"
run: terraform plan -out=tfplan

- name: "Terraform Apply"
if: github.ref == 'refs/heads/feature-#7'
run: terraform apply -auto-approve tfplan

6 changes: 6 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
provider "aws" {
region = "ap-northeast-2" # 서울 리전
}



Loading