Skip to content

Commit

Permalink
[7.17] Add required tags to create AWS instances for CI (#37717)
Browse files Browse the repository at this point in the history
* add required tags

* try to change credentials-id
  • Loading branch information
kaiyan-sheng authored Jan 25, 2024
1 parent 9fde16e commit cb1769c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .ci/jobs/beats-schedule-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
wipe-workspace: 'True'
name: origin
shallow-clone: true
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
credentials-id: github-app-beats-ci
reference-repo: /var/lib/jenkins/.git-references/beats.git
branches:
- $branch_specifier
Expand Down
13 changes: 13 additions & 0 deletions x-pack/filebeat/input/awscloudwatch/_meta/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ terraform {

provider "aws" {
region = var.aws_region
default_tags {
tags = {
environment = var.ENVIRONMENT
repo = var.REPO
branch = var.BRANCH
build = var.BUILD_ID
created_date = var.CREATED_DATE
division = "engineering"
org = "obs"
team = "cloud-monitoring"
project = "filebeat_aws-ci"
}
}
}

resource "random_string" "random" {
Expand Down
23 changes: 23 additions & 0 deletions x-pack/filebeat/input/awscloudwatch/_meta/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,26 @@ variable "aws_region" {
type = string
default = "us-east-1"
}

variable "BRANCH" {
description = "Branch name or pull request for tagging purposes"
default = "unknown-branch"
}

variable "BUILD_ID" {
description = "Build ID in the CI for tagging purposes"
default = "unknown-build"
}

variable "CREATED_DATE" {
description = "Creation date in epoch time for tagging purposes"
default = "unknown-date"
}

variable "ENVIRONMENT" {
default = "unknown-environment"
}

variable "REPO" {
default = "unknown-repo-name"
}
4 changes: 4 additions & 0 deletions x-pack/filebeat/input/awss3/_meta/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ provider "aws" {
branch = var.BRANCH
build = var.BUILD_ID
created_date = var.CREATED_DATE
division = "engineering"
org = "obs"
team = "cloud-monitoring"
project = "filebeat_aws-ci"
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions x-pack/metricbeat/module/aws/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ provider "aws" {
branch = var.BRANCH
build = var.BUILD_ID
created_date = var.CREATED_DATE
division = "engineering"
org = "obs"
team = "cloud-monitoring"
project = "metricbeat_aws-ci"
}
}
}
Expand Down

0 comments on commit cb1769c

Please sign in to comment.