mirror of
https://github.com/dap-ps/infra-dapps.git
synced 2025-02-23 17:38:13 +00:00
create an elastic beanstalk app for development
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
6f108c653c
commit
36226c51c1
86
dev.tf
86
dev.tf
@ -1,3 +1,89 @@
|
|||||||
|
/* ACCESS ---------------------------------------*/
|
||||||
|
|
||||||
|
resource "aws_iam_group" "deploy" {
|
||||||
|
name = "dev-dap-ps-deploy"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_iam_user" "deploy" {
|
||||||
|
name = "dap-ps-deploy"
|
||||||
|
tags = {
|
||||||
|
Description = "User for deploying the dap.ps Elastic Beanstalk app"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_iam_user_group_membership" "deploy" {
|
||||||
|
user = "${aws_iam_user.deploy.name}"
|
||||||
|
groups = ["${aws_iam_group.deploy.name}"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_iam_policy" "policy" {
|
||||||
|
name = "test-policy"
|
||||||
|
description = "A test policy"
|
||||||
|
|
||||||
|
policy = <<EOF
|
||||||
|
{
|
||||||
|
"Version": "2012-10-17",
|
||||||
|
"Statement": [
|
||||||
|
{
|
||||||
|
"Effect": "Allow",
|
||||||
|
"Action": [
|
||||||
|
"s3:GetBucketLocation",
|
||||||
|
"s3:ListAllMyBuckets"
|
||||||
|
],
|
||||||
|
"Resource": "arn:aws:s3:::*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Effect": "Allow",
|
||||||
|
"Action": "s3:*",
|
||||||
|
"Resource": [
|
||||||
|
"arn:aws:s3:::${aws_s3_bucket.dev_dap_ps.id}",
|
||||||
|
"arn:aws:s3:::${aws_s3_bucket.dev_dap_ps.id}/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_iam_policy_attachment" "deploy" {
|
||||||
|
name = "deploy-policy-attachment"
|
||||||
|
users = ["${aws_iam_user.deploy.name}"]
|
||||||
|
groups = ["${aws_iam_group.deploy.name}"]
|
||||||
|
policy_arn = "${aws_iam_policy.policy.arn}"
|
||||||
|
}
|
||||||
|
|
||||||
/* RESOURCES ------------------------------------*/
|
/* RESOURCES ------------------------------------*/
|
||||||
|
|
||||||
|
resource "aws_s3_bucket" "dev_dap_ps" {
|
||||||
|
bucket = "${var.dap_ps_app_bucket_name}"
|
||||||
|
acl = "private"
|
||||||
|
|
||||||
|
tags = {
|
||||||
|
Name = "dev.dap.ps application bucket"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_s3_bucket_object" "dev_dap_ps" {
|
||||||
|
bucket = "${aws_s3_bucket.dev_dap_ps.id}"
|
||||||
|
key = "dapps.zip"
|
||||||
|
source = "files/dapps.zip"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_elastic_beanstalk_application" "dev_dap_ps" {
|
||||||
|
name = "dev-dap-ps-app"
|
||||||
|
description = "dev.dap.ps application"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_elastic_beanstalk_application_version" "dev_dap_ps" {
|
||||||
|
name = "dev-dap-ps-app"
|
||||||
|
description = "dev.dap.ps application version (Terraform)"
|
||||||
|
application = "${aws_elastic_beanstalk_application.dev_dap_ps.name}"
|
||||||
|
bucket = "${aws_s3_bucket.dev_dap_ps.id}"
|
||||||
|
key = "${aws_s3_bucket_object.dev_dap_ps.id}"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_elastic_beanstalk_environment" "dev_dap_ps" {
|
||||||
|
name = "dev-dap-ps-app"
|
||||||
|
application = "${aws_elastic_beanstalk_application.dev_dap_ps.name}"
|
||||||
|
solution_stack_name = "64bit Amazon Linux 2018.03 v4.8.3 running Node.js"
|
||||||
|
}
|
||||||
|
5
dns.tf
5
dns.tf
@ -21,7 +21,10 @@ resource "gandi_zonerecord" "dap_ps_mx" {
|
|||||||
|
|
||||||
/* MAIL SITE ------------------------------------*/
|
/* MAIL SITE ------------------------------------*/
|
||||||
|
|
||||||
/* This is the main site hosted on GitHub */
|
/**
|
||||||
|
* This is the main site hosted on GitHub:
|
||||||
|
* https://github.com/dap-ps/discover
|
||||||
|
**/
|
||||||
resource "gandi_zonerecord" "dap_ps_site" {
|
resource "gandi_zonerecord" "dap_ps_site" {
|
||||||
zone = "${gandi_zone.dap_ps_zone.id}"
|
zone = "${gandi_zone.dap_ps_zone.id}"
|
||||||
name = "@"
|
name = "@"
|
||||||
|
@ -56,6 +56,13 @@ variable ssh_user {
|
|||||||
default = "ubuntu"
|
default = "ubuntu"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DEV Dap.ps -----------------------------------*/
|
||||||
|
|
||||||
|
variable dap_ps_app_bucket_name {
|
||||||
|
description = "Name of bucket to which we deploy the dap.ps dapp"
|
||||||
|
default = "dev-dap-ps-app"
|
||||||
|
}
|
||||||
|
|
||||||
/* SES FORWARDER --------------------------------*/
|
/* SES FORWARDER --------------------------------*/
|
||||||
|
|
||||||
variable ses_forwarder_bucket_name {
|
variable ses_forwarder_bucket_name {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user