Skip to content

Instantly share code, notes, and snippets.

View cluster-template.yaml
apiVersion: kops/v1alpha2
kind: Cluster
metadata:
name: {{.kubernetes_cluster_name.value}}
spec:
api:
loadBalancer:
type: Public
additionalSecurityGroups: ["{{.common_http_sg_id.value}}"]
authorization:
View outputs.tf
output "region" {
value = "${data.aws_region.current.name}"
}
output "vpc_id" {
value = "${module.dev_vpc.vpc_id}"
}
output "vpc_name" {
value = "${local.vpc_name}"
View security_groups.tf
resource "aws_security_group" "k8s_common_http" {
name = "${local.environment}_k8s_common_http"
vpc_id = "${module.dev_vpc.vpc_id}"
tags = "${merge(local.tags)}"
ingress {
from_port = 80
protocol = "tcp"
to_port = 80
cidr_blocks = ["${local.ingress_ips}"]
View s3_buckets.tf
resource "aws_s3_bucket" "kops_state" {
bucket = "${local.kops_state_bucket_name}"
acl = "private"
force_destroy = true
tags = "${merge(local.tags)}"
}
View vpc.tf
module "dev_vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "1.46.0"
name = "${local.vpc_name}"
cidr = "10.0.0.0/16"
azs = ["${local.azs}"]
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
enable_nat_gateway = true
View main.tf
provider "aws" {
region = "eu-west-2"
}
terraform {
backend "s3" {
bucket = "tf-state-blog"
key = "dev/terraform"
region = "eu-west-2"
}
View keybase.md

Keybase proof

I hereby claim:

  • I am albertoal on github.
  • I am albertoal (https://keybase.io/albertoal) on keybase.
  • I have a public key ASBJcMfXEHwZbyCppcXMs3UENs5KsvRqP5qdKl563o7szAo

To claim this, I am signing this object: