mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +00:00
Some small terraform updates
This commit is contained in:
parent
bcd1981d9a
commit
84133bd212
@ -3,26 +3,23 @@
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
# IAM Role for Redirect Lambda
|
||||
|
||||
data "aws_iam_policy_document" "lambda_redirect" {
|
||||
statement {
|
||||
actions = ["sts:AssumeRole"]
|
||||
|
||||
principals {
|
||||
type = "Service"
|
||||
identifiers = [
|
||||
"edgelambda.amazonaws.com",
|
||||
"lambda.amazonaws.com"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_iam_role" "lambda_redirect" {
|
||||
name = "${var.site}-lambda-redirect-role"
|
||||
assume_role_policy = <<EOF
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Action": "sts:AssumeRole",
|
||||
"Principal": {
|
||||
"Service": [
|
||||
"edgelambda.amazonaws.com",
|
||||
"lambda.amazonaws.com"
|
||||
]
|
||||
},
|
||||
"Effect": "Allow",
|
||||
"Sid": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
assume_role_policy = data.aws_iam_policy_document.lambda_redirect.json
|
||||
|
||||
tags = {
|
||||
Site = var.site
|
||||
@ -60,9 +57,6 @@ data "aws_iam_policy_document" "lambda_assume_role" {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
resource "aws_iam_role" "ipixel_parser" {
|
||||
name = "lambda-${var.site}-ipixel"
|
||||
|
||||
|
@ -1,31 +1,4 @@
|
||||
|
||||
resource "aws_s3_bucket" "temp_redirect" {
|
||||
bucket = "${var.site}-redirect"
|
||||
acl = "public-read"
|
||||
|
||||
website {
|
||||
index_document = "index.html"
|
||||
error_document = "index.html"
|
||||
# redirect_all_requests_to = "https://curvyandtrans.com/p/740D5B/gender-dysphoria/"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_object" "redirect_page" {
|
||||
bucket = aws_s3_bucket.temp_redirect.bucket
|
||||
key = "index.html"
|
||||
acl = "public-read"
|
||||
content_type = "text/html"
|
||||
|
||||
metadata = {
|
||||
"website-redirect-location" = "https://curvyandtrans.com/p/740D5B/gender-dysphoria/"
|
||||
}
|
||||
content = <<EOF
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<meta http-equiv="refresh" content="0;URL='https://curvyandtrans.com/p/740D5B/gender-dysphoria/'" />
|
||||
</head><body></body></html>
|
||||
EOF
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------------------------------------
|
||||
# Cloudfront Configuration
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user