Commit 49d63414 authored by Cameron McFarland's avatar Cameron McFarland

Adding roles.

parent 8cf0f75b
......@@ -159,6 +159,106 @@ resource "aws_iam_policy" "snowplow_s3loader_policy" {
EOF
}
// Roles
resource "aws_iam_role" "snowplow_collector_role" {
name = "snowplow-collector-role"
assume_role_policy = <<EOF
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Principal":{
"Service":"ec2.amazonaws.com"
},
"Action":"sts:AssumeRole"
},
{
"Effect":"Allow",
"Principal":{
"Service":"ecs-tasks.amazonaws.com"
},
"Action":"sts:AssumeRole"
},
{
"Effect":"Allow",
"Principal":{
"Service":"ecs.amazonaws.com"
},
"Action":"sts:AssumeRole"
}
]
}
EOF
tags = {
environment = "SnowPlow"
}
}
resource "aws_iam_role" "snowplow_enricher_role" {
name = "snowplow-enricher-role"
assume_role_policy = <<EOF
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Principal":{
"Service":"ec2.amazonaws.com"
},
"Action":"sts:AssumeRole"
}
]
}
EOF
tags = {
environment = "SnowPlow"
}
}
resource "aws_iam_role" "snowplow_s3loader_role" {
name = "snowplow-s3loader-role"
assume_role_policy = <<EOF
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Principal":{
"Service":"ec2.amazonaws.com"
},
"Action":"sts:AssumeRole"
}
]
}
EOF
tags = {
environment = "SnowPlow"
}
}
// Role Policy Attachments
resource "aws_iam_role_policy_attachment" "collector_role_policy_attachment" {
role = "${aws_iam_role.snowplow_collector_role.name}"
policy_arn = "${aws_iam_policy.snowplow_collector_policy.arn}"
}
resource "aws_iam_role_policy_attachment" "enricher_role_policy_attachment" {
role = "${aws_iam_role.snowplow_enricher_role.name}"
policy_arn = "${aws_iam_policy.snowplow_enricher_policy.arn}"
}
resource "aws_iam_role_policy_attachment" "s3loader_role_policy_attachment" {
role = "${aws_iam_role.snowplow_s3loader_role.name}"
policy_arn = "${aws_iam_policy.snowplow_s3loader_policy.arn}"
}
// VPC
resource "aws_vpc" "snowplow_vpc" {
cidr_block = "10.32.0.0/16"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment