bitovi/Deploy Prometheus and Grafana
Deploy prometheus and grafana to AWS Virtual Machine (EC2).
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stalelast commit Jan 28, 2025
- License
- MIT
Pinned Snippet
uses: bitovi/github-actions-deploy-prometheus@4dcb7eb223c8957ab6ba16fc4766c8eb01ae3081 # v0.1.2tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| checkout | Specifies if this action should checkout the code | no | true |
| aws_access_key_id | AWS access key ID | no | — |
| aws_secret_access_key | AWS secret access key | no | — |
| aws_session_token | AWS session token, if you are using temporary credentials | no | — |
| aws_default_region | AWS default region | no | — |
| aws_resource_identifier | Auto-generated by default so it is unique for org/repo/branch. Set to override with custom naming the unique AWS resource identifier for the deployment. Defaults to `${org}-${repo}-${branch}`. | — | — |
| aws_additional_tags | A list of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}` | no | — |
| env_aws_secret | Secret name to pull env variables from AWS Secret Manager, could be a comma separated list, read in order. Expected JSON content. | no | — |
| env_repo | File containing environment variables to be used with the app | no | — |
| env_ghs | `.env` file to be used with the app from Github secrets | no | — |
| env_ghv | `.env` file to be used with the app from Github variables | no | — |
| aws_ec2_instance_type | The AWS EC2 instance type | no | t3.medium |
| aws_ec2_iam_instance_profile | The AWS IAM instance profile to use for the EC2 instance. Use if you want to pass an AWS role with specific permissions granted to the instance | no | — |
| aws_ec2_create_keypair_sm | Creates a Secret in AWS secret manager to store a kypair | no | false |
| aws_ec2_instance_root_vol_size | Root disk size for the EC2 instance | no | 10 |
| aws_ec2_additional_tags | A JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}` | no | — |
| aws_ec2_ami_filter | AMI filter to use when searching for an AMI to use for the EC2 instance. Defaults to `ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*` | no | ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* |
| grafana_datasource_dir | Path to the grafana datasource directory | no | observability/grafana/datasources |
| prometheus_config | Path to the prometheus config file | no | observability/prometheus/prometheus.yml |
| grafana_scrape_interval | How frequently to scrape targets by default in the Prometheus data-source. | no | — |
| prometheus_scrape_interval | How frequently to scrape targets by default | no | 15s |
| prometheus_retention_period | When to remove old data. Defaults to 15d. | no | 15d |
| cadvisor_enable | Enable cadvisor container in docker-compose | no | — |
| cadvisor_extra_targets | Add cadvisor target | no | — |
| node_exporter_enable | Enable node-exporter container in docker-compose | no | — |
| node_exporter_extra_targets | Add node-exporter target | no | — |
| print_yaml_files | — | no | — |
| tf_stack_destroy | Set to "true" to Destroy the created AWS infrastructure for this instance | — | false |
| tf_state_file_name | Change this to be anything you want to. Carefull to be consistent here. A missing file could trigger recreation, or stepping over destruction of non-defined objects. | no | — |
| tf_state_file_name_append | Append a string to the tf-state-file. Setting this to `unique` will generate `tf-state-aws-unique`. Can co-exist with the tf_state_file_name variable. | no | — |
| tf_state_bucket | AWS S3 bucket to use for Terraform state. Defaults to `${org}-${repo}-{branch}-tf-state-aws` | no | — |
| tf_state_bucket_destroy | Force purge and deletion of S3 tf_state_bucket defined. Any file contained there will be destroyed. `tf_stack_destroy` must also be `true` | no | — |
| aws_r53_domain_name | Define the root domain name for the application. e.g. app.com | no | — |
| aws_r53_sub_domain_name | Define the sub-domain part of the URL. Defaults to `${org}-${repo}-{branch}` | no | — |
| aws_r53_root_domain_deploy | Deploy to root domain. Will generate two DNS recrods, one for root, another for www | no | — |
| aws_r53_enable_cert | Makes the application use a certificate by enabling a certificate lookup. | no | — |
| aws_r53_cert_arn | Define the certificate ARN to use for the application | no | — |
| aws_r53_create_root_cert | Generates and manage the root cert for the application | no | — |
| aws_r53_create_sub_cert | Generates and manage the sub-domain certificate for the application | no | — |
| aws_r53_additional_tags | A JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}` | no | — |
| aws_vpc_create | Define if a VPC should be created | no | — |
| aws_vpc_name | Set a specific name for the VPC | no | — |
| aws_vpc_cidr_block | Define Base CIDR block which is divided into subnet CIDR blocks. Defaults to 10.0.0.0/16. | no | — |
| aws_vpc_public_subnets | Comma separated list of public subnets. Defaults to 10.10.110.0/24 | no | — |
| aws_vpc_private_subnets | Comma separated list of private subnets. If none, none will be created. | no | — |
| aws_vpc_availability_zones | Comma separated list of availability zones. Defaults to `aws_default_region. | no | — |
| aws_vpc_id | AWS VPC ID. Accepts `vpc-###` values. | no | — |
| aws_vpc_subnet_id | Specify a Subnet to be used with the instance. If none provided, will pick one. | no | — |
| aws_vpc_enable_nat_gateway | Enables NAT gateway | no | — |
| aws_vpc_single_nat_gateway | Creates only one NAT gateway | no | — |
| aws_vpc_external_nat_ip_ids | Comma separated list of IP IDS to reuse in the NAT gateways | no | — |
| aws_vpc_additional_tags | A JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}` | no | — |
| docker_cloudwatch_enable | Toggle cloudwatch creation for Docker containers. | no | true |
| docker_cloudwatch_skip_destroy | Toggle deletion or not when destroying the stack. | no | false |
| aws_ec2_instance_public_ip | Add a public IP to the instance or not. (Not an Elastic IP) | no | true |
| aws_ec2_port_list | List of ports to be enabled as an ingress rule in the EC2 SG, in a [xx,yy] format - Not the ELB | no | — |
| aws_elb_create | Create a load balancer and map ports to the EC2 instance. | no | true |
| aws_elb_app_port | Port to expose for the app | no | — |
| aws_elb_listen_port | Load balancer listening port. Defaults to 80 if NO FQDN provided, 443 if FQDN provided | no | 3000,9090 |
Outputs
| name | description |
|---|---|
| aws_vpc_id | The selected VPC ID used. |
| vm_url | The URL of the generated app |
| instance_endpoint | The URL of the generated ec2 instance |
| ec2_sg_id | SG ID for the EC2 instance |