Skip to content

Instantly share code, notes, and snippets.

@limed
limed / main.tf
Created November 21, 2018 01:51
subnet math
provider "aws" {
region = "us-west-2"
}
variable "az_number" {
default = {
a = 1
b = 2
c = 3
d = 4
@limed
limed / Dockerfile
Last active October 26, 2018 19:09
FROM mdnwebdocs/mdn-admin:2f6c560
ENV AWS_ACCESS_KEY_ID setme
ENV AWS_SECRET_ACCESS_KEY setme
RUN mkdir -p /mdn /data
RUN groupadd --gid 1000 kuma
RUN useradd -ms /bin/bash --uid 1000 --gid 1000 kuma
USER kuma:kuma
@limed
limed / deregister-ami
Created September 27, 2018 22:41
Deregister and delete ami based on tags
#!/bin/bash
project_name=$1
if [ -z ${project_name} ]; then
echo "Usage: $0 <project_name>"
exit 1
fi
regions="$(aws ec2 describe-regions --query "Regions[].RegionName" --output text)"
#!/bin/bash
# Look at supplied value
if [ "$(nubis-metadata status)" == 'ready' ]; then
NUBIS_SWAP_SIZE_MEG=$(nubis-metadata NUBIS_SWAP_SIZE_MEG 2>/dev/null)
fi
# Use sane default otherwise
if [ -z "$NUBIS_SWAP_SIZE_MEG" ]; then
NUBIS_SWAP_SIZE_MEG=512
Error: module.vpcs.module.us-west-2.module.kubnernetes.module.kops_bucket.aws_s3_bucket.bucket: "lifecycle_rule.0.expiration.0.days" must be greater than 0
Error: module.vpcs.module.us-west-2.module.kubnernetes.module.kops_bucket.aws_s3_bucket.bucket: "lifecycle_rule.1.transition.0.storage_class" must be one of '"STANDARD_IA"', '"GLACIER"'
Error: module.vpcs.module.us-west-2.module.kubnernetes.module.kops_bucket.aws_s3_bucket.bucket: : invalid or unknown key: server_side_encryption_configuration
diff --git a/nubis/files/nubis-ci-deploy b/nubis/files/nubis-ci-deploy
index 3e14338..77282a7 100755
--- a/nubis/files/nubis-ci-deploy
+++ b/nubis/files/nubis-ci-deploy
@@ -7,6 +7,9 @@ declare environment
declare service_name
declare TF_CONSUL_WORKAROUND
+# We are skipping builds
+SKIP_BUILD=$(jq -r '.variables.skip_build' nubis/builder/project.json)
diff --git a/nubis/files/nubis-ci-build b/nubis/files/nubis-ci-build
index 4d7c3e0..3b7fc59 100644
--- a/nubis/files/nubis-ci-build
+++ b/nubis/files/nubis-ci-build
@@ -2,6 +2,14 @@
set -e
+DEPLOY_ONLY=$(jq -r '.variables.deploy_only' nubis/builder/project.json)
+
module "mdn_shared" {
source = "github.com/limed/infra//apps/mdn/mdn-aws/infra/shared?ref=mdn-refactor"
enabled = "${lookup(var.features, "shared-infra")}"
region = "${var.region}"
environment = "${var.environment}"
}
module "mdn_cdn" {
source = "github.com/limed/infra//apps/mdn/mdn-aws/infra/mdn-cdn?ref=mdn-refactor"
enabled = "${lookup(var.features, "cdn")}"
diff --git a/input.tf b/input.tf
index df22c1a..e66f48d 100644
--- a/input.tf
+++ b/input.tf
@@ -55,6 +55,7 @@ variable features {
default = {
vpc = 1
consul = 1
+ kubernetes = 0
jumphost = 0
Host ssh.mozilla.com
User elim
ControlMaster auto
ControlPath ~/.ssh/controlmasters/%r@%h:%p
Host *.mozilla.com
User elim
ForwardAgent no
ProxyCommand ssh -W %h:%p -oProxyCommand=none ssh.mozilla.com