Skip to content

Commit eaf6234

Browse files
authored
Merge pull request #210 from ruby-no-kai/sponsor-app-mod
ruby-no-kai/sponsor-app#99
2 parents 0b3e0d2 + 7e3ce9e commit eaf6234

File tree

8 files changed

+151
-0
lines changed

8 files changed

+151
-0
lines changed

tf/sponsor-app/.mairu.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"server": "https://amc.rubykaigi.net/api/remote/",
3+
"role": "arn:aws:iam::005216166247:role/OrgzAdmin"
4+
}

tf/sponsor-app/.terraform.lock.hcl

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tf/sponsor-app/acm.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data "aws_acm_certificate" "use1-sponsorships-rk-o" {
2+
provider = aws.use1
3+
domain = "sponsorships.rubykaigi.org"
4+
most_recent = true
5+
}

tf/sponsor-app/aws.tf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
data "aws_caller_identity" "current" {}
2+
3+
locals {
4+
aws_account_id = "005216166247"
5+
}
6+
7+
provider "aws" {
8+
region = "us-west-2"
9+
allowed_account_ids = [local.aws_account_id]
10+
default_tags {
11+
tags = {
12+
Project = "sponsor-app"
13+
}
14+
}
15+
}
16+
17+
provider "aws" {
18+
alias = "use1"
19+
region = "us-east-1"
20+
allowed_account_ids = [local.aws_account_id]
21+
default_tags {
22+
tags = {
23+
Project = "sponsor-app"
24+
}
25+
}
26+
}
27+
28+
provider "aws" {
29+
alias = "apne1"
30+
region = "ap-northeast-1"
31+
allowed_account_ids = [local.aws_account_id]
32+
default_tags {
33+
tags = {
34+
Project = "sponsor-app"
35+
}
36+
}
37+
}

tf/sponsor-app/backend.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
backend "s3" {
3+
bucket = "rk-infra"
4+
workspace_key_prefix = "terraform"
5+
key = "terraform/sponsor-app.tfstate"
6+
region = "ap-northeast-1"
7+
use_lockfile = true
8+
}
9+
}

tf/sponsor-app/dev.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module "dev" {
2+
source = "../../../sponsor-app/tf"
3+
4+
providers = {
5+
aws = aws
6+
aws.cloudfront = aws.use1
7+
aws.files = aws.apne1
8+
}
9+
10+
environment = "dev"
11+
service_name = "sponsor-app-dev"
12+
sqs_name_suffix = "dev"
13+
iam_role_prefix = "SponsorAppDev"
14+
iam_apprunner_access_name = "AppraSponsorAppDev"
15+
16+
s3_bucket_name = "rk-sponsorship-files-dev"
17+
s3_cors_origins = [
18+
"http://localhost:13000",
19+
"http://localhost:13010",
20+
"http://localhost:3000",
21+
"https://amc.rubykaigi.net",
22+
]
23+
24+
enable_cloudfront = false
25+
enable_sqs = false
26+
enable_apprunner = false
27+
enable_amc_oidc = true
28+
enable_shared_resources = false
29+
30+
github_actions_sub = "repo:ruby-no-kai/sponsor-app:ref:refs/heads/master"
31+
}

tf/sponsor-app/prd.tf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module "prd" {
2+
source = "../../../sponsor-app/tf"
3+
4+
providers = {
5+
aws = aws
6+
aws.cloudfront = aws.use1
7+
aws.files = aws.apne1
8+
}
9+
10+
environment = "production"
11+
service_name = "sponsor-app"
12+
sqs_name_suffix = "prd"
13+
iam_role_prefix = "SponsorApp"
14+
iam_apprunner_access_name = "AppraSponsorApp"
15+
16+
s3_bucket_name = "rk-sponsorship-files-prd"
17+
s3_cors_origins = ["https://sponsorships.rubykaigi.org"]
18+
19+
enable_cloudfront = true
20+
enable_sqs = true
21+
enable_apprunner = true
22+
enable_amc_oidc = false
23+
enable_shared_resources = true
24+
25+
app_domain = "sponsorships.rubykaigi.org"
26+
certificate_arn = data.aws_acm_certificate.use1-sponsorships-rk-o.arn
27+
cloudfront_log_bucket = "rk-aws-logs.s3.amazonaws.com"
28+
cloudfront_log_prefix = "cf/sponsorships.rubykaigi.org/"
29+
cloudfront_comment = "sponsor-app"
30+
31+
github_actions_sub = "repo:ruby-no-kai/sponsor-app:environment:production"
32+
}

tf/sponsor-app/versions.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
}
6+
}
7+
required_version = ">= 0.13"
8+
}

0 commit comments

Comments
 (0)