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
# create some variables | |
variable "cluster_name" { | |
type = string | |
description = "EKS cluster name." | |
} | |
variable "cluster_endpoint" { | |
type = string | |
description = "Endpoint for your Kubernetes API server." | |
} | |
variable "cluster_certificate_authority_data" { |
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
resource "aws_acm_certificate" "certificate" { | |
certificate_body = acme_certificate.certificate.certificate_pem | |
private_key = acme_certificate.certificate.private_key_pem | |
certificate_chain = acme_certificate.certificate.issuer_pem | |
} |
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
#!/bin/bash | |
amazon-linux-extras install nginx1 -y | |
chkconfig nginx on | |
service nginx start |
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
# . . . remaining part of /etc/gitlab-runner/config.toml | |
[runners.machine] | |
MachineDriver = "azure" | |
MachineName = "gitlab-docker-machine-%s" | |
MachineOptions = [ | |
"azure-subscription-id=xxx", | |
"azure-client-id=xxx", | |
"azure-client-secret=xxx", | |
"azure-resource-group=gitlab-ci", |
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
# . . . remaining part of /etc/gitlab-runner/config.toml | |
[runners.machine] | |
MachineDriver = "google" | |
MachineName = "gitlab-docker-machine-%s" | |
MachineOptions = [ | |
"google-project=xxxxx", | |
"google-network=xxxxx", | |
"google-subnetwork=xxxxx", | |
"google-use-internal-ip=true", |
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
# . . . remaining part of /etc/gitlab-runner/config.toml | |
[runners.machine] | |
MachineDriver = "amazonec2" | |
MachineName = "gitlab-docker-machine-%s" | |
MachineOptions = [ | |
"amazonec2-access-key=XXXX", | |
"amazonec2-secret-key=XXXX", | |
"amazonec2-region=us-central-1", | |
"amazonec2-vpc-id=vpc-xxxxx", |
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
# /etc/gitlab-runner/config.toml | |
concurrent = 10 | |
[[runners]] | |
name = "gitlab-ci-runner-bastion" | |
url = "https://gitlab.com/" | |
token = "our-own-gitlab-token-goes-here" | |
executor = "docker+machine" | |
[runners.docker] |
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
terraform { | |
required_version = "~> 1.9.5" | |
required_providers { | |
acme = { | |
source = "vancluever/acme" | |
version = "~> 2.5.3" | |
} | |
aws = { | |
source = "hashicorp/aws" |
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
output "certificate_pem" { | |
value = acme_certificate.certificate.certificate_pem | |
} | |
output "issuer_pem" { | |
value = acme_certificate.certificate.issuer_pem | |
} | |
output "private_key_pem" { | |
value = nonsensitive(acme_certificate.certificate.private_key_pem) |
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
resource "aws_s3_object" "certificate_artifacts_s3_objects" { | |
for_each = toset(["certificate_pem", "issuer_pem", "private_key_pem"]) | |
bucket = "test-singh-cl-ssl-cert" # TODO put your own S3 bucket, and create it before if necessary! | |
key = each.key # TODO prefix with your own bucket path if there is any | |
content = lookup(acme_certificate.certificate, "${each.key}") | |
} |