There are few things which needs to be there already in your Account
- Ecs Task Execution Role for EC2 - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html#create-task-execution-role
- EC2 Role - Basically these 2 rules would be enough (AmazonEC2ContainerServiceforEC2Role, AmazonEC2FullAccess)
- If you are using S3 for using Terafform State, S3 Bucket needs to be created before hand.
To Create Cluster on AWS EC2 Using ECS Cluster
terraform init
terraform apply -var profile=aws-dev -var key_name=foo ecs_execution_role_arn=foo ecs_task_role_arn=foo
Instead of Passing the Variables from Command Line, you can always provide the values by using vars.tf or creating .tfvars file.
No requirements.
| Name | Version |
|---|---|
| aws | n/a |
No modules.
| Name | Type |
|---|---|
| aws_default_route_table.jenkins-default-route-table | resource |
| aws_default_security_group.jenkins-default-sg | resource |
| aws_ecs_cluster.jenkins_cluster | resource |
| aws_ecs_service.jenkins | resource |
| aws_ecs_task_definition.jenkins-task | resource |
| aws_instance.jenkins-instance | resource |
| aws_internet_gateway.jenkins-igw | resource |
| aws_subnet.jenkins-pub-sn | resource |
| aws_vpc.jenkins | resource |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| ami | n/a | string |
"ami-0e13e0df31e6aa478" |
no |
| ecs_execution_role_arn | n/a | string |
"" |
no |
| ecs_task_role_arn | n/a | string |
"" |
no |
| instance_type | n/a | string |
"t2.micro" |
no |
| key_name | n/a | string |
"" |
no |
| profile | n/a | string |
"default" |
no |
| public_subnet_cidr | n/a | string |
"10.0.0.0/24" |
no |
| region | n/a | string |
"ap-south-1" |
no |
| subnet-az | n/a | string |
"ap-south-1a" |
no |
| vpc_cidr | n/a | string |
"10.0.0.0/16" |
no |
| Name | Description |
|---|---|
| public_dns | n/a |