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
from hashlib import sha1 | |
import json | |
def generate_cache_key(start_url, role_name, account_id): | |
args = { | |
'startUrl': start_url, | |
'roleName': role_name, | |
'accountId': account_id, | |
} |
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
# Lots of other resources are created and all of that stuff works so I'm just skipping the not-so-relevant parts. | |
resource "aws_route_table" "private" { | |
for_each = toset(var.public_subnets) | |
vpc_id = aws_vpc.main.id | |
route { | |
cidr_block = "0.0.0.0/0" | |
nat_gateway_id = aws_nat_gateway.natgw[each.key].id #this ressource exists andd is based on a foreach of the public_subnets variable, I just omitted it from the example here. | |
} |
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
# Change line 138/139 from | |
# except AuthenticationError: | |
# raise AnsibleError('Invalid credentials provided.') | |
#to: | |
except AuthenticationError as e: | |
raise AnsibleError(str(e)) | |
#This will surface the actual exception from azure, instead of just printing a generic one. | |
#It might be possible to use `(e)` instead of `(str(e))` depending on what param AnsibleError takes. It might provide more info |
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
#Install pips: | |
#aws-cdk-cdk | |
#aws-cdk-aws-ec2 | |
import json | |
from aws_cdk import cdk | |
from aws_cdk import aws_ec2 | |
app = cdk.App() | |
stack = cdk.Stack(app, 'MyStack') |
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
#Spin up Kubernetes control plane as part of before_script, and destroys it using after_script | |
#Some custom logic to get to the right ip address | |
#Requres the gitlab docker runner, with "pass-thru" to the host docker socket. | |
stages: | |
- test | |
image: python:3.6.6 #the docker image you run in needs Docker installed, and access to the host docker socket. | |
test_integration_k8s: | |
tags: |
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
import boto3 | |
from bloop import BaseModel, Column, String, Engine | |
from flask import Flask | |
from flask_injector import FlaskInjector, singleton | |
from flask_restful import Api, Resource | |
from injector import inject, provider | |
import random | |
import string | |
from bloop_local import patched_local_bloop_engine |
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
- name: Replay GETs against staging #arbitrary name | |
methods: #only replay these requests | |
- get | |
paths: #replay these paths (use wildcard-notation because I suck at regex) | |
- "/api/1/*" | |
host_names: #The hostnames to match on | |
- api.domain.com | |
strip_headers: #remove these headers before replaying the request (list of strings). You can use wildcards such as | |
- "X-*" #strip away all X-type headers | |
- "User-Agent" #Strip away this and add a new one down below |
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
--- | |
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: config-ansiblejobservicefrontend-v{{ major_version }}-{{ environment }}-{{ environmentid }}-httpsecure | |
namespace: sre | |
annotations: | |
traefik.frontend.passHostHeader: "true" | |
labels: | |
expose: internal-httpsecure |
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
--- | |
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: traefik-ingress-controller-internal-httpsecure-{{ environment }} | |
namespace: networking | |
labels: | |
app: traefik-ingress-lb-internal-httpsecure | |
environment: "{{ environment }}" | |
environmentid: "{{ environmentid }}" |
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
Traceback (most recent call last): | |
File "/home/trond/apps/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1664, in <module> | |
main() | |
File "/home/trond/apps/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1658, in main | |
globals = debugger.run(setup['file'], None, None, is_module) | |
File "/home/trond/apps/pycharm-community-2018.1.1/helpers/pydev/pydevd.py", line 1068, in run | |
pydev_imports.execfile(file, globals, locals) # execute the script | |
File "/home/trond/apps/pycharm-community-2018.1.1/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile | |
exec(compile(contents+"\n", file, 'exec'), glob, loc) | |
File "/home/trond/Documents/projects-rikstv/SRE/RiksTV.Utils.ServiceOwnership/runserver.py", line 1, in <module> |
NewerOlder