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
| data "template_file" "lnx_script" { | |
| template = "${file("${path.module}/templates/lnx_script.sh")}" | |
| vars { | |
| var1 = "${var.var1}" | |
| } | |
| } | |
| resource "aws_instance" "myinstance" { | |
| connection { | |
| type = "ssh" |
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
| { | |
| "schemaVersion": "0.3", | |
| "description": "Updates a Microsoft Windows AMI. By default it will install all Windows updates, Amazon software, and Amazon drivers. It will then sysprep and create a new AMI. Supports Windows Server 2008 R2 and greater.", | |
| "assumeRole": "{{ AutomationAssumeRole }}", | |
| "parameters": { | |
| "SourceAmiId": { | |
| "type": "String", | |
| "description": "(Required) The source Amazon Machine Image ID." | |
| }, | |
| "TopicArn": { |
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
| # ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use: | |
| # "${data.external.ssh_key_generator.result.public_key}" (contents) | |
| # "${data.external.ssh_key_generator.result.private_key}" (contents) | |
| # "${data.external.ssh_key_generator.result.private_key_file}" (path) | |
| data "external" "ssh_key_generator" { | |
| program = ["bash", "${path.root}/../ssh_key_generator.sh"] | |
| query = { | |
| customer_name = "${var.customer_name}" | |
| customer_group = "${var.customer_group}" |
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
| """ Lambda to launch ec2-instances """ | |
| import boto3 | |
| REGION = 'eu-central-1' # region to launch instance. | |
| AMI = 'ami-24bd1b4b' | |
| # matching region/setup amazon linux ami, as per: | |
| # https://aws.amazon.com/amazon-linux-ami/ | |
| INSTANCE_TYPE = 'm3.medium' # instance type to launch. | |
| EC2 = boto3.client('ec2', region_name=REGION) |
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
| description: |- | |
| ### EC2 stopper by tag | |
| Stop EC2 instances by tag | |
| schemaVersion: '0.3' | |
| mainSteps: | |
| - name: getInstancesByTag | |
| action: 'aws:executeAwsApi' | |
| outputs: | |
| - Name: InstanceIds |
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
| sudo ip addr show dev enp1s0f2 | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' |
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
| { | |
| "StartAt": "RegisterBuildkiteAgents", | |
| "TimeoutSeconds": 1800, | |
| "States": { | |
| "RegisterBuildkiteAgents": { | |
| "Type": "Pass", | |
| "Result": { | |
| "TaskDefinitions": { | |
| "Definitions": [], | |
| "Count": 0 |
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
| resource "aws_db_instance" "postgres" { | |
| identifier = "${var.postgres_id}" | |
| name = "${var.postgres_name}" | |
| engine = "${var.postgres_engine}" | |
| engine_version = "${var.postgres_version}" | |
| multi_az = "${var.postgres_multi_az}" | |
| instance_class = "${var.postgres_class}" | |
| db_subnet_group_name = "${var.postgres_subnet_group}" |
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 boto | |
| r53conn = boto.connect_route53(aws_access_key_id="xxxxxxxxxxxxxx",aws_secret_access_key="yyyyyyyyyy") | |
| recordSets = r53conn.get_zone("yourdomain.in") | |
| #Sorry for the hacky way.....! | |
| for recordset in recordSets.get_records(): | |
| print recordset.name + " : " + recordset.to_print() |