File tree Expand file tree Collapse file tree 10 files changed +123
-4
lines changed
aws_ec2_autoscale_cluster Expand file tree Collapse file tree 10 files changed +123
-4
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,12 @@ aws_ec2_autoscale_cluster:
144
144
health_check_timeout : 5
145
145
health_check_healthy_count : 5
146
146
health_check_unhealthy_count : 2
147
+ # # Target Group Stickiness. Disabled by default unless set otherwise. Uncomment if needed:
148
+ # target_group_stickiness_enabled: true
149
+ # target_group_stickiness_type: "lb_cookie" # Valid values are lb_cookie, app_cookie or source_ip.
150
+ # target_group_stickiness_app_cookie_name: "my_app_cookie"
151
+ # target_group_stickiness_app_cookie_duration: 86400
152
+ # target_group_stickiness_lb_cookie_duration: 86400
147
153
# ALB settings
148
154
create_elb : true # determines whether an ELB (currently, this is an ALB) is created as part of the ASG. This needs to be `true` in order to create a CloudFront distribution.
149
155
alb_idle_timeout : 60
Original file line number Diff line number Diff line change 336
336
health_check_timeout : " {{ aws_ec2_autoscale_cluster.health_check_timeout }}"
337
337
healthy_threshold_count : " {{ aws_ec2_autoscale_cluster.health_check_healthy_count }}"
338
338
unhealthy_threshold_count : " {{ aws_ec2_autoscale_cluster.health_check_unhealthy_count }}"
339
+ stickiness_enabled : " {{ aws_ec2_autoscale_cluster.target_group_stickiness_enabled | default(omit) }}"
340
+ stickiness_type : " {{ aws_ec2_autoscale_cluster.target_group_stickiness_type | default(omit) }}"
341
+ stickiness_app_cookie_name : " {{ aws_ec2_autoscale_cluster.target_group_stickiness_app_cookie_name | default(omit) }}"
342
+ stickiness_app_cookie_duration : " {{ aws_ec2_autoscale_cluster.target_group_stickiness_app_cookie_duration | default(omit) }}"
343
+ stickiness_lb_cookie_duration : " {{ aws_ec2_autoscale_cluster.target_group_stickiness_lb_cookie_duration | default(omit) }}"
339
344
modify_targets : false
340
345
register : _aws_ec2_target_group_created
341
346
when :
Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ aws_elb:
45
45
# - example-server-two
46
46
targets_port : 80 # Port to forward to on target servers.
47
47
modify_targets : false # Set to true if this is a standalone ELB, so the list of targets in the target group can be updated.
48
+ # # Target Group Stickiness. Disabled by default unless set otherwise. Uncomment if needed:
49
+ # stickiness_enabled: true
50
+ # stickiness_type: "lb_cookie" # Valid values are lb_cookie, app_cookie or source_ip.
51
+ # stickiness_app_cookie_name: "my_app_cookie"
52
+ # stickiness_app_cookie_duration: 86400
53
+ # stickiness_lb_cookie_duration: 86400
48
54
# ELB settings
49
55
idle_timeout : 60
50
56
ip_address_type : " ipv4" # Can be 'ipv4' or 'dualstack' (the latter includes IPv4 and IPv6 addresses).
Original file line number Diff line number Diff line change 30
30
health_check_timeout : " {{ target_group.health_check_timeout }}"
31
31
healthy_threshold_count : " {{ target_group.health_check_healthy_count }}"
32
32
unhealthy_threshold_count : " {{ target_group.health_check_unhealthy_count }}"
33
+ stickiness_enabled : " {{ target_group.stickiness_enabled | default(omit) }}"
34
+ stickiness_type : " {{ target_group.stickiness_type | default(omit) }}"
35
+ stickiness_app_cookie_name : " {{ target_group.stickiness_app_cookie_name | default(omit) }}"
36
+ stickiness_app_cookie_duration : " {{ target_group.stickiness_app_cookie_duration | default(omit) }}"
37
+ stickiness_lb_cookie_duration : " {{ target_group.stickiness_lb_cookie_duration | default(omit) }}"
33
38
modify_targets : " {{ target_group.modify_targets }}"
34
39
targets : " {{ _targets }}"
Original file line number Diff line number Diff line change 1
- ### {{ ansible_managed }}
2
-
3
1
{
4
2
"logs": {
5
3
"logs_collected": {
Original file line number Diff line number Diff line change 1
- ### {{ ansible_managed }}
2
-
3
1
{
4
2
"logs": {
5
3
"logs_collected": {
Original file line number Diff line number Diff line change 55
55
max_accelerated_files : 2000
56
56
validate_timestamps : 1
57
57
clear_env : " yes"
58
+ # Cloudwatch log settings.
59
+ log_group_prefix : " "
60
+ log_stream_name : example
Original file line number Diff line number Diff line change 53
53
with_items : " {{ php.version }}"
54
54
loop_control :
55
55
loop_var : version
56
+
57
+ - name : Check if we have an AWS Cloudwatch folder.
58
+ ansible.builtin.stat :
59
+ path : /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d
60
+ register : _php_cloudwatch_dir
61
+
62
+ - name : Generate AWS Cloudwatch config for a single, fixed port PHP version.
63
+ ansible.builtin.template :
64
+ src : cloudwatch-php-fpm-fixedport.json.j2
65
+ dest : /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/php-fpm.json
66
+ force : true
67
+ when :
68
+ - _php_cloudwatch_dir.stat.isdir is defined and _php_cloudwatch_dir.stat.isdir
69
+ - php.fpm.tcp_port | length > 0
70
+
71
+ - name : Generate AWS Cloudwatch config for dynamic PHP versioning.
72
+ ansible.builtin.template :
73
+ src : cloudwatch-php-fpm.json.j2
74
+ dest : /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/php-fpm.json
75
+ force : true
76
+ with_items : " {{ php.version }}"
77
+ when :
78
+ - _php_cloudwatch_dir.stat.isdir is defined and _php_cloudwatch_dir.stat.isdir
79
+ - php.fpm.tcp_port | length == 0
80
+ loop_control :
81
+ loop_var : version
Original file line number Diff line number Diff line change
1
+ {
2
+ "logs": {
3
+ "logs_collected": {
4
+ "files": {
5
+ "collect_list": [
6
+ {
7
+ "file_path": "/var/log/php{{ php.version[0] }}-fpm.log",
8
+ {% if php .fpm .log_group_prefix is defined and php .fpm .log_group_prefix |length %}
9
+ "log_group_name": "{{ php.fpm.log_group_prefix }}php{{ php.version[0] }}",
10
+ {% else %}
11
+ "log_group_name": "php",
12
+ {% endif %}
13
+ {% if php .fpm .log_stream_name is defined and php .fpm .log_stream_name |length %}
14
+ "log_stream_name": "{{ php.fpm.log_stream_name }}"
15
+ {% else %}
16
+ "log_stream_name": "php-fpm"
17
+ {% endif %}
18
+ },
19
+ {
20
+ "file_path": "{{ php.fpm.slowlog_file_directory }}/php{{ php.version[0] }}-fpm.slow.log",
21
+ {% if php .fpm .log_group_prefix is defined and php .fpm .log_group_prefix |length %}
22
+ "log_group_name": "{{ php.fpm.log_group_prefix }}php{{ php.version[0] }}",
23
+ {% else %}
24
+ "log_group_name": "php",
25
+ {% endif %}
26
+ {% if php .fpm .log_stream_name is defined and php .fpm .log_stream_name |length %}
27
+ "log_stream_name": "{{ php.fpm.log_stream_name }}-slowlog"
28
+ {% else %}
29
+ "log_stream_name": "php-fpm-slowlog"
30
+ {% endif %}
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ }
36
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "logs": {
3
+ "logs_collected": {
4
+ "files": {
5
+ "collect_list": [
6
+ {
7
+ "file_path": "/var/log/php{{ version }}-fpm.log",
8
+ {% if php .fpm .log_group_prefix is defined and php .fpm .log_group_prefix |length %}
9
+ "log_group_name": "{{ php.fpm.log_group_prefix }}php{{ version }}",
10
+ {% else %}
11
+ "log_group_name": "php",
12
+ {% endif %}
13
+ {% if php .fpm .log_stream_name is defined and php .fpm .log_stream_name |length %}
14
+ "log_stream_name": "{{ php.fpm.log_stream_name }}"
15
+ {% else %}
16
+ "log_stream_name": "php-fpm"
17
+ {% endif %}
18
+ },
19
+ {
20
+ "file_path": "{{ php.fpm.slowlog_file_directory }}/php{{ version }}-fpm.slow.log",
21
+ {% if php .fpm .log_group_prefix is defined and php .fpm .log_group_prefix |length %}
22
+ "log_group_name": "{{ php.fpm.log_group_prefix }}php{{ version }}",
23
+ {% else %}
24
+ "log_group_name": "php",
25
+ {% endif %}
26
+ {% if php .fpm .log_stream_name is defined and php .fpm .log_stream_name |length %}
27
+ "log_stream_name": "{{ php.fpm.log_stream_name }}-slowlog"
28
+ {% else %}
29
+ "log_stream_name": "php-fpm-slowlog"
30
+ {% endif %}
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments