-
Notifications
You must be signed in to change notification settings - Fork 129
Add test package with docker service deployers using terraform too #2670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2cd9a67
Add test package with docker and terraform
mrodm 7155d5c
Update system testing docs
mrodm aaa1c9e
Remove some environment variables in test package example
mrodm 191b9c4
Update section about test package example
mrodm 533e11b
Merge upstream/main into example-several-service-deployers
mrodm 3a4648b
Rephrase paragraph from test package example section
mrodm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add test package with docker and terraform
- Loading branch information
commit 2cd9a6783bb6ee1ed969fc7284b193800f96ebd8
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
test/packages/parallel/nginx_multiple_services/_dev/build/build.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| dependencies: | ||
| ecs: | ||
| reference: [email protected] |
31 changes: 31 additions & 0 deletions
31
test/packages/parallel/nginx_multiple_services/_dev/build/docs/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Nginx Integration | ||
|
|
||
| This integration periodically fetches metrics from [Nginx](https://nginx.org/) servers. It can parse access and error | ||
| logs created by the HTTP server. | ||
|
|
||
| ## Compatibility | ||
|
|
||
| The logs were tested with version 1.19.5. | ||
| On Windows, the module was tested with Nginx installed from the Chocolatey repository. | ||
|
|
||
| ## Logs | ||
|
|
||
| **Timezone support** | ||
|
|
||
| This datasource parses logs that don’t contain timezone information. For these logs, the Elastic Agent reads the local | ||
| timezone and uses it when parsing to convert the timestamp to UTC. The timezone to be used for parsing is included | ||
| in the event in the `event.timezone` field. | ||
|
|
||
| To disable this conversion, the event.timezone field can be removed with the drop_fields processor. | ||
|
|
||
| If logs are originated from systems or applications with a different timezone to the local one, the `event.timezone` | ||
| field can be overwritten with the original timezone using the add_fields processor. | ||
|
|
||
| ### Access Docker & TF Logs | ||
|
|
||
| Access logs collects the nginx access logs. | ||
|
|
||
| {{event "access_docker_tf"}} | ||
|
|
||
| {{fields "access_docker_tf"}} | ||
|
|
6 changes: 6 additions & 0 deletions
6
test/packages/parallel/nginx_multiple_services/_dev/deploy/docker/Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ARG SERVICE_VERSION=${SERVICE_VERSION:-1.19.5} | ||
| FROM nginx:${SERVICE_VERSION} | ||
| RUN sed -i "/jessie-updates/d" /etc/apt/sources.list | ||
| RUN apt-get update && apt-get install -y curl | ||
| HEALTHCHECK --interval=1s --retries=90 CMD curl -f http://localhost/server-status | ||
| COPY ./nginx.conf /etc/nginx/ |
8 changes: 8 additions & 0 deletions
8
test/packages/parallel/nginx_multiple_services/_dev/deploy/docker/docker-compose.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| version: '2.3' | ||
| services: | ||
| nginx: | ||
| build: . | ||
| ports: | ||
| - 80 | ||
| volumes: | ||
| - ${SERVICE_LOGS_DIR}:/var/log/nginx |
33 changes: 33 additions & 0 deletions
33
test/packages/parallel/nginx_multiple_services/_dev/deploy/docker/nginx.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| user nginx; | ||
| worker_processes 1; | ||
|
|
||
| error_log /dev/stderr warn; | ||
| pid /var/run/nginx.pid; | ||
|
|
||
|
|
||
| events { | ||
| worker_connections 1024; | ||
| } | ||
|
|
||
|
|
||
| http { | ||
| include /etc/nginx/mime.types; | ||
| default_type application/octet-stream; | ||
|
|
||
| log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
| '$status $body_bytes_sent "$http_referer" ' | ||
| '"$http_user_agent" "$http_x_forwarded_for"'; | ||
| access_log /var/log/nginx/access.log main; | ||
|
|
||
| server { | ||
| listen [::]:80; | ||
| listen 80; | ||
| server_name localhost; | ||
|
|
||
| location /server-status { | ||
| stub_status on; | ||
| } | ||
| } | ||
|
|
||
| include /etc/nginx/conf.d/*; | ||
| } |
2 changes: 2 additions & 0 deletions
2
test/packages/parallel/nginx_multiple_services/_dev/test/config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| system: | ||
| parallel: false |
96 changes: 96 additions & 0 deletions
96
test/packages/parallel/nginx_multiple_services/changelog.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # newer versions go on top | ||
| - version: "999.999.999" | ||
| changes: | ||
| - description: Change test public IPs to the supported subset | ||
| type: bugfix | ||
| link: https://github.com/elastic/integrations/pull/2327 | ||
| - version: "1.2.1" | ||
| changes: | ||
| - description: Fix ML module manifest query to ignore frozen and cold tiers | ||
| type: bugfix | ||
| link: https://github.com/elastic/integrations/pull/2219 | ||
| - version: "1.2.0" | ||
| changes: | ||
| - description: Release nginx package for v8.0.0 | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/2176 | ||
| - version: "1.1.2" | ||
| changes: | ||
| - description: Uniform with guidelines | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/2052 | ||
| - version: "1.1.1" | ||
| changes: | ||
| - description: Fix logic that checks for the 'forwarded' tag | ||
| type: bugfix | ||
| link: https://github.com/elastic/integrations/pull/1835 | ||
| - version: "1.1.0" | ||
| changes: | ||
| - description: Update to ECS 1.12.0 | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/1701 | ||
| - version: "1.0.0" | ||
| changes: | ||
| - description: Release Nginx as GA | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/1614 | ||
| - version: "0.8.2" | ||
| changes: | ||
| - description: Convert to generated ECS fields | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/1491 | ||
| - version: "0.8.1" | ||
| changes: | ||
| - description: update to ECS 1.11.0 | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/1398 | ||
| - version: "0.8.0" | ||
| changes: | ||
| - description: Update integration description | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/1364 | ||
| - version: "0.7.0" | ||
| changes: | ||
| - description: Set "event.module" and "event.dataset" | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/1234 | ||
| - version: "0.6.2" | ||
| changes: | ||
| - description: Add support for Splunk authorization tokens | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/1147 | ||
| - version: "0.6.1" | ||
| changes: | ||
| - description: Fix bug in Third Party REST API ingest pipeline | ||
| type: bugfix | ||
| link: https://github.com/elastic/integrations/pull/1201 | ||
| - version: "0.6.0" | ||
| changes: | ||
| - description: update to ECS 1.10.0 and add event.original options | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/1065 | ||
| - version: "0.5.0" | ||
| changes: | ||
| - description: Adds ML jobs for finding unusual activity in HTTP access logs | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/912 | ||
| - version: "0.4.1" | ||
| changes: | ||
| - description: update to ECS 1.9.0 | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/859 | ||
| - version: "0.3.11" | ||
| changes: | ||
| - description: Updating package owner | ||
| type: enhancement | ||
| link: https://github.com/elastic/integrations/pull/766 | ||
| - version: "0.3.10" | ||
| changes: | ||
| - description: Fix compatibility with Kibana | ||
| type: enhancement # can be one of: enhancement, bugfix, breaking-change | ||
| link: https://github.com/elastic/integrations/pull/740 | ||
| - version: "0.1.0" | ||
| changes: | ||
| - description: initial release | ||
| type: enhancement # can be one of: enhancement, bugfix, breaking-change | ||
| link: https://github.com/elastic/integrations/pull/21 |
6 changes: 6 additions & 0 deletions
6
...rallel/nginx_multiple_services/data_stream/access_docker_tf/_dev/deploy/docker/Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ARG SERVICE_VERSION=${SERVICE_VERSION:-1.19.5} | ||
| FROM nginx:${SERVICE_VERSION} | ||
| RUN sed -i "/jessie-updates/d" /etc/apt/sources.list | ||
| RUN apt-get update && apt-get install -y curl | ||
| HEALTHCHECK --interval=1s --retries=90 CMD curl -f http://localhost/server-status | ||
| COPY ./nginx.conf /etc/nginx/ |
26 changes: 26 additions & 0 deletions
26
...nx_multiple_services/data_stream/access_docker_tf/_dev/deploy/docker/Dockerfile.terraform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| FROM --platform=linux/amd64 ubuntu:24.04 | ||
| ENV TERRAFORM_VERSION=1.9.6 | ||
|
|
||
| # Based on this Dockerfile: | ||
| # https://github.com/elastic/elastic-package/blob/d8e4300715af43b3b792d25960d75c3382948dcd/internal/servicedeployer/_static/Dockerfile.terraform_deployer | ||
| # This dockerfile just installs terraform and sets up the environment to run terraform commands. | ||
|
|
||
| RUN apt-get -qq update \ | ||
| && apt-get install -yq curl apt-transport-https ca-certificates gnupg \ | ||
| && apt-get clean | ||
|
|
||
| RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg \ | ||
| && echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com noble main" | tee /etc/apt/sources.list.d/hashicorp.list \ | ||
| && apt-get update -qq \ | ||
| && apt-get install -yq terraform=${TERRAFORM_VERSION}-1 \ | ||
| && apt-get clean | ||
|
|
||
| HEALTHCHECK --timeout=3s CMD sh -c "[ -f /tmp/tf-applied ]" | ||
|
|
||
| ENV TF_IN_AUTOMATION=true | ||
| ENV TF_CLI_ARGS="-no-color" | ||
| ADD terraform.run.sh /run.sh | ||
| RUN chmod +x /run.sh | ||
| WORKDIR /workspace | ||
|
|
||
| ENTRYPOINT exec /run.sh |
35 changes: 35 additions & 0 deletions
35
...ginx_multiple_services/data_stream/access_docker_tf/_dev/deploy/docker/docker-compose.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| version: '2.3' | ||
| services: | ||
| nginx: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - 80 | ||
| volumes: | ||
| - ${SERVICE_LOGS_DIR}:/var/log/nginx | ||
| depends_on: | ||
| terraform: | ||
| condition: service_healthy | ||
| terraform: | ||
| tty: true | ||
| stop_grace_period: 5m | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.terraform | ||
| environment: | ||
| - TF_VAR_TEST_RUN_ID=${TEST_RUN_ID:-detached} | ||
| - TF_VAR_CREATED_DATE=${CREATED_DATE:-unknown} | ||
| - TF_VAR_BRANCH=${BRANCH_NAME_LOWER_CASE:-unknown} | ||
| - TF_VAR_BUILD_ID=${BUILD_ID:-unknown} | ||
| - TF_VAR_ENVIRONMENT=${ENVIRONMENT:-unknown} | ||
| - TF_VAR_REPO=${REPO:-unknown} | ||
| # Example to use credentials | ||
| - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
| - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
| - AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} | ||
| - AWS_PROFILE=${AWS_PROFILE} | ||
| - AWS_REGION=${AWS_REGION:-us-east-1} | ||
| volumes: | ||
| - ./tf/:/stage/ | ||
| - ${SERVICE_LOGS_DIR}:/tmp/service_logs/ | ||
33 changes: 33 additions & 0 deletions
33
...rallel/nginx_multiple_services/data_stream/access_docker_tf/_dev/deploy/docker/nginx.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| user nginx; | ||
| worker_processes 1; | ||
|
|
||
| error_log /dev/stderr warn; | ||
| pid /var/run/nginx.pid; | ||
|
|
||
|
|
||
| events { | ||
| worker_connections 1024; | ||
| } | ||
|
|
||
|
|
||
| http { | ||
| include /etc/nginx/mime.types; | ||
| default_type application/octet-stream; | ||
|
|
||
| log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
| '$status $body_bytes_sent "$http_referer" ' | ||
| '"$http_user_agent" "$http_x_forwarded_for"'; | ||
| access_log /var/log/nginx/access.log main; | ||
|
|
||
| server { | ||
| listen [::]:80; | ||
| listen 80; | ||
| server_name localhost; | ||
|
|
||
| location /server-status { | ||
| stub_status on; | ||
| } | ||
| } | ||
|
|
||
| include /etc/nginx/conf.d/*; | ||
| } |
33 changes: 33 additions & 0 deletions
33
.../nginx_multiple_services/data_stream/access_docker_tf/_dev/deploy/docker/terraform.run.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euxo pipefail | ||
|
|
||
| # Terraform code may rely on content from other files than .tf files (es json, zip, html, text), so we copy all the content over | ||
| # See more: https://github.com/elastic/elastic-package/pull/603 | ||
| # NOTE: must copy hidden files too (supported by "/.") | ||
| # See more: https://github.com/elastic/package-spec/issues/269 | ||
| cp -r /stage/. /workspace | ||
|
|
||
| cleanup() { | ||
| r=$? | ||
|
|
||
| set -x | ||
| terraform destroy -auto-approve | ||
|
|
||
| exit $r | ||
| } | ||
| trap cleanup EXIT INT TERM | ||
|
|
||
| terraform init | ||
| terraform plan | ||
| terraform apply -auto-approve | ||
|
|
||
| mkdir -p /output | ||
| terraform output -json > /output/tfOutputValues.json | ||
|
|
||
| touch /tmp/tf-applied # This file is used as indicator (healthcheck) that the service is UP, and so it must be placed as the last statement in the script | ||
|
|
||
| echo "Terraform definitions applied." | ||
|
|
||
| set +x | ||
| while true; do sleep 1; done # wait for ctrl-c |
21 changes: 21 additions & 0 deletions
21
...nx_multiple_services/data_stream/access_docker_tf/_dev/deploy/docker/tf/files/example.log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| ::1 - - [03/Jun/2025:14:41:33 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:34 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:35 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:36 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:37 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:38 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:39 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:40 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:41 +0000] "GET /server-status-tf HTTP/1.1" 200 97 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:42 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:43 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:45 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:46 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:47 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:48 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:49 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:50 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:51 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:52 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:53 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" | ||
| ::1 - - [03/Jun/2025:14:41:54 +0000] "GET /server-status-tf HTTP/1.1" 200 100 "-" "curl/7.64.0" "-" |
37 changes: 37 additions & 0 deletions
37
...rallel/nginx_multiple_services/data_stream/access_docker_tf/_dev/deploy/docker/tf/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Remember to set default tags in case the provider allows for that. | ||
| # Example for the "aws" provider | ||
| # provider "aws" { | ||
| # region = "us-east-1" | ||
| # default_tags { | ||
| # tags = { | ||
| # environment = var.ENVIRONMENT | ||
| # repo = var.REPO | ||
| # branch = var.BRANCH | ||
| # build = var.BUILD_ID | ||
| # created_date = var.CREATED_DATE | ||
| # } | ||
| # } | ||
| # } | ||
|
|
||
| resource "local_file" "log" { | ||
| source = "./files/example.log" | ||
| filename = "/tmp/service_logs/file.log" | ||
| file_permission = "0777" | ||
| } | ||
|
|
||
| locals { | ||
| items ={ | ||
| environment = "${var.ENVIRONMENT}" | ||
| repo = "${var.REPO}" | ||
| branch = "${var.BRANCH}" | ||
| build = "${var.BUILD_ID}" | ||
| created_date = "${var.CREATED_DATE}" | ||
| test_run_id = "${var.TEST_RUN_ID}" | ||
| } | ||
| } | ||
|
|
||
| resource "local_file" "log_variables" { | ||
| content = format("%s\n", jsonencode(local.items)) | ||
| filename = "/tmp/service_logs/file_vars.log" | ||
| file_permission = "0777" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add these environment variables as example here too?
I haven't tested if that works, but probably it works.
If it is required to create resources in AWS, probably they should use the terraform deployer. WDYT ? To remove it from the example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can remove them by now, and added later if requested.