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 io import BytesIO | |
| import gzip | |
| import shutil | |
| def upload_gzipped(bucket, key, fp, compressed_fp=None, content_type='text/plain'): | |
| """Compress and upload the contents from fp to S3. | |
| If compressed_fp is None, the compression is performed in memory. | |
| """ |
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
| ### Option 1 - Terraform can generate SSL/SSH private keys using the tls_private_key resource | |
| variable "key_name" {} | |
| resource "tls_private_key" "example" { | |
| algorithm = "RSA" | |
| rsa_bits = 4096 | |
| } | |
| resource "aws_key_pair" "generated_key" { |
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
| # First find the vpc | |
| data "aws_vpc" "admin" { | |
| filter { | |
| name = "tag:Name" | |
| values = ["vpc-admin_svcs-${local.short_region}*-${local.dns_zone}"] | |
| } | |
| } | |
| # This will expand to all subnets in the vpc which match the filter, but they will be returned in | |
| # no particular order. |
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
| # This policy uses the tfstate import to restrict ACM certificates | |
| # to have domains that are sub-domains of hashidemos.io | |
| # Import the v2 tfstate import, but use the alias "tfstate" | |
| import "tfstate/v2" as tfstate | |
| # Import common-functions/tfstate-functions.sentinel with alias "state" | |
| import "tfstate-functions" as state | |
| # Get all AWS ACM certs |
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
| acm.amazonaws.com | |
| alexa-appkit.amazon.com | |
| apigateway.amazonaws.com | |
| application-autoscaling.amazonaws.com | |
| appstream.application-autoscaling.amazonaws.com | |
| appsync.amazonaws.com | |
| athena.amazonaws.com | |
| autoscaling.amazonaws.com | |
| batch.amazonaws.com | |
| channels.lex.amazonaws.com |
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
| #!/usr/bin/env python | |
| import twitter | |
| import boto3 | |
| import os | |
| keyword = 'dev.classmethod.jp' | |
| region = 'us-east-1' | |
| size = 10 * 100 |
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
| #!/usr/bin/env python | |
| import twitter | |
| import boto3 | |
| import os | |
| keyword = '#reinvent' | |
| lang = 'en' | |
| region = 'us-east-1' | |
| size = 100 * 100 |
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
| #!/usr/bin/env python | |
| from boto.connection import AWSAuthConnection | |
| import requests | |
| import json | |
| import sys | |
| def main(): | |
| host = sys.argv[1] |
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
| //The global script scope | |
| def ctx = context(scope: scriptScope()) | |
| //What things can be on the script scope | |
| contributor(ctx) { | |
| method(name: 'pipeline', type: 'Object', params: [body: Closure]) | |
| property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable') | |
| property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder') | |
| property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder') | |
| property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar') |
NewerOlder