-
Notifications
You must be signed in to change notification settings - Fork 6
/
codedeploy.tf
55 lines (46 loc) · 1.46 KB
/
codedeploy.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
resource "aws_codedeploy_app" "ar_io_nodes" {
compute_platform = "Server"
name = "ar-io-nodes-${var.alias}"
}
resource "aws_codedeploy_deployment_group" "ar_io_nodes" {
app_name = aws_codedeploy_app.ar_io_nodes.name
deployment_group_name = "ar-io-nodes-${var.alias}"
service_role_arn = aws_iam_role.ar_io_nodes_code_deploy_role.arn
deployment_style {
deployment_option = "WITH_TRAFFIC_CONTROL"
deployment_type = "IN_PLACE"
}
autoscaling_groups = [
aws_autoscaling_group.ar_io_nodes_asg.name
]
load_balancer_info {
target_group_info {
name = aws_lb_target_group.ar_io_nodes_tg.name
}
}
auto_rollback_configuration {
enabled = true
events = ["DEPLOYMENT_FAILURE"]
}
}
resource "aws_s3_bucket" "codedeploy_deployments" {
bucket_prefix = "ar-io-nodes-${var.alias}-codedeploy-"
force_destroy = true # bucket doesn't contain critical data, only release files.
}
resource "aws_s3_bucket_ownership_controls" "codedeploy_deployments" {
bucket = aws_s3_bucket.codedeploy_deployments.id
rule {
object_ownership = "BucketOwnerEnforced"
}
}
resource "aws_s3_bucket_public_access_block" "codedeploy_deployments" {
bucket = aws_s3_bucket.codedeploy_deployments.id
block_public_acls = true
block_public_policy = true
}
resource "aws_s3_bucket_versioning" "codedeploy_deployments" {
bucket = aws_s3_bucket.codedeploy_deployments.id
versioning_configuration {
status = "Enabled"
}
}