Skip to content

Instantly share code, notes, and snippets.

import click
import mps.aws
import mps.config
from mps.exceptions import NoCredentialsException
# create module-specific logger
logger = logging.getLogger(__name__)
@robinbowes
robinbowes / curl.headers
Created November 21, 2017 23:56
Problems grabbing a tarball from Sourceforge
HTTP/1.1 307 Temporary Redirect
Server: nginx
Date: Tue, 21 Nov 2017 23:55:12 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 428
Connection: close
Location: https://sourceforge.net/projects/libpng/files/libpng16/1.6.34/libpng-1.6.34.tar.gz/download?use_mirror=kent
HTTP/1.1 200 OK
Server: nginx
@robinbowes
robinbowes / main.tf
Created October 6, 2017 11:51
Example of terraform issue
provider "aws" {
region = "${var.aws_region}"
}
variable "aws_region" {
default = "eu-west-1"
}
variable "asg_max_size" {
default = "6"
@robinbowes
robinbowes / gist:5af7a23b1e007c7af3a8327acca49b7d
Created October 6, 2017 11:49
Trace of failing terraform plan
2017/10/06 12:48:46 [INFO] Terraform version: 0.10.7
2017/10/06 12:48:46 [INFO] Go runtime version: go1.9
2017/10/06 12:48:46 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.10.7/bin/terraform", "plan"}
2017/10/06 12:48:46 [DEBUG] Attempting to open CLI config file: /Users/robin/.terraformrc
2017/10/06 12:48:46 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/10/06 12:48:46 [DEBUG] CLI Config is main.Config{Providers:map[string]string{}, Provisioners:map[string]string{}, DisableCheckpoint:false, DisableCheckpointSignature:false, PluginCacheDir:""}
2017/10/06 12:48:46 [INFO] CLI command args: []string{"plan"}
2017/10/06 12:48:46 [INFO] command: empty terraform config, returning nil
2017/10/06 12:48:46 [DEBUG] command: no data state file found for backend config
2017/10/06 12:48:46 [DEBUG] New state was assigned lineage "86e0689d-4b5b-411c-ba1f-cd62024c90d1"
locals {
backend_dns_name = "${var.dns_modifier}backend.${var.public_domain}"
}
locals {
backend_api_base = "https://${local.backend_dns_name}"
}
output "backend_dns_name" {
value = "${local.backend_dns_name}"
[Librarian] Resolving choria-mcollective (>= 0) <https://forgeapi.puppetlabs.com>
[Librarian] Checking manifests
[Librarian] Module choria-mcollective found versions: 0.0.29, 0.0.28, 0.0.27, 0.0.26, 0.0.25, 0.0.24
[Librarian] Checking choria-mcollective/0.0.29 <https://forgeapi.puppetlabs.com>
[Librarian] Resolved choria-mcollective (>= 0) <https://forgeapi.puppetlabs.com> at choria-mcollective/0.0.29 <https://forgeapi.puppetlabs.com>
[Librarian] Resolved choria-mcollective (>= 0) <https://forgeapi.puppetlabs.com>
[Librarian] Resolving choria-mcollective_choria (>= 0) <https://forgeapi.puppetlabs.com>
[Librarian] Checking manifests
[Librarian] Module choria-mcollective_choria found versions: 0.1.0, 0.0.28, 0.0.27, 0.0.26, 0.0.25, 0.0.24, 0.0.23, 0.0.22
[Librarian] Checking choria-mcollective_choria/0.1.0 <https://forgeapi.puppetlabs.com>
aws_elastic_beanstalk_environment.eb_env: Refreshing state... (ID: e-vfbepvyeps)
aws_elastic_beanstalk_environment.eb_env: Modifying... (ID: e-vfbepvyeps)
setting.#: "20" => "31"
setting.1051605865.name: "SecurityGroups" => "SecurityGroups"
setting.1051605865.namespace: "aws:autoscaling:launchconfiguration" => "aws:autoscaling:launchconfiguration"
setting.1051605865.resource: "" => ""
setting.1051605865.value: "sg-0efe8874,sg-4dbec837" => "sg-4dbec837,sg-0efe8874"
setting.1093784765.name: "" => "ListenerProtocol"
setting.1093784765.namespace: "" => "aws:elb:listener:80"
setting.1093784765.resource: "" => ""
"modules": [
{
"path": [
"root"
],
"outputs": {
"database_subnets": {
"sensitive": false,
"type": "list",
"value": [
@robinbowes
robinbowes / plugin.py
Last active March 9, 2017 16:29
Questions about python style
from status_response import StatusResponse
class SomeClass:
def __init__(self):
self._status = "foo"
@property
def status(self)
return self._status
Error: Calling Formula.sha1 is disabled!
Use Formula.sha256 instead.
/opt/boxen/homebrew/Library/Taps/boxen/homebrew-brews/dnsmasq.rb:6:in `<class:Dnsmasq>'
Please report this to the boxen/brews tap!
Please report this bug:
https://git.io/brew-troubleshooting
/opt/boxen/homebrew/Library/Homebrew/utils.rb:86:in `odeprecated'
/opt/boxen/homebrew/Library/Homebrew/utils.rb:94:in `odisabled'
/opt/boxen/homebrew/Library/Homebrew/compat/sha1.rb:3:in `sha1'
/opt/boxen/homebrew/Library/Taps/boxen/homebrew-brews/dnsmasq.rb:6:in `<class:Dnsmasq>'