Python3 sample script to get metrics from AWS CloudWatch. In the example, we get the maximum value in the last minute and display only the value, this is necessary if you want to collect metrics for example in Zabbix. Script:
Where, "XXXXXXXXXXX" – AWS Account ID, "us-east-1" – AWS Region
For a parameterized assembly with an image tag selection, you will need the Active Choices plugin Go to "Manage Jenkins" Section "Manage Plugins" Go to the "Available" tab and select "Active Choices" in the search. Install it. Create a "New Item" – "Pipeline", indicate that it will be a parameterized assembly, and …
Continue reading "Jenkins – Active Choice: AWS ECR Images tag (AWS SDK)"
For a parameterized assembly with an image tag selection, you will need the Active Choices plugin Go to "Manage Jenkins" Section "Manage Plugins" Go to the "Available" tab and select "Active Choices" in the search. Install it. Create a "New Item" – "Pipeline", indicate that it will be a parameterized assembly, and …
Continue reading "Jenkins – Active Choice: AWS ECR Images tag (AWS Cli)"
Example using AWS Cli only, without third-party utilities Example using "jq" utility
When trying to get a value from AWS SSM, Ansible Playbook using Python3 as an interpreter generates the following error: fatal: [localhost-py3]: FAILED! => {"changed": false, "msg": "AnsibleError: An unhandled exception occurred while templating '{{ lookup('aws_ssm', 'server_listeners', decrypt=false, region=’eu-west-1′) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup …
Continue reading "FIX ERROR – Ansible AWS SSM: AnsibleError: An unhandled exception occurred while templating"
HTTPS In order to be able to work with the Git repository in CodeCommit using the AIM role, AWS Cli must be installed on the instance. You will also need "credential-helper", for this we create a configuration file for Git: And copy the following into it: Now you can work with CodeCommit over …
Continue reading "CodeCommit – Git"
To get the IP addresses of all instances with the "Application" tag and its value "Frontend", and also filter by state to display information about only those instances that are in the "running" state: To display the name of instance along with the IP address:
When creating an HTTP/HTTPS subscription in AWS SNS, you can observe that the subscription is hanging in the status: "Pending confirmation" SNS to the specified URL makes a POST request in which it sends data in JSON format and expects to receive a key value in response: "SubscribeURL". But if the application does not …
Continue reading " AWS SNS – HTTP(S) Subscription: manual confirmation"
In this example, we will create a Terraform module for the AWS provider, which will be launched for 3 different environments using Terragrunt. Requirements: Installed AWS CLI Installed Terraform (version above 12.0) Installed Terragrunt