Skip to content

Instantly share code, notes, and snippets.

View foxutech's full-sized avatar

FoxuTech foxutech

View GitHub Profile
---
- name: Provision an EC2 Instance
hosts: local
connection: local
gather_facts: False
tags: provisioning
# Necessary Variables for creating/provisioning the EC2 Instance
vars:
instance_type: t1.micro
security_group: testserver # Change the security group name here
---
- hosts: localhost
connection: local
gather_facts: false
user: root
pre_tasks:
- include_vars: ec2_vars/{{type}}.yml
roles:
- provision-ec2
---
- name: Provision EC2 Box
local_action:
module: ec2
key_name: "{{ ec2_keypair }}"
group_id: "{{ ec2_security_group }}"
instance_type: "{{ ec2_instance_type }}"
image: "{{ ec2_image }}"
vpc_subnet_id: "{{ ec2_subnet_ids|random }}"
region: "{{ ec2_region }}"
@foxutech
foxutech / pods.yaml
Last active February 16, 2018 11:54
apiVersion: v1
kind: Pod
metadata:
name: kubee
spec:
containers:
- name: test
image: nginx
ports:
- containerPort: 80
...
Containers:
test:
...
Limits:
cpu: 500m
memory: 64Mi
Requests:
cpu: 500m
memory: 64Mi
variable "name" { default = "us-west-2-cloudfront-resource-demo" }
variable "region" { default = "us-west-2" }
variable "access_key" { }
variable "secret_key" { }
variable "acl" { default = "public-read" }
variable "policy_file" { default = "policy.json.tpl" }
variable "index" { default = "index.html" }
provider "aws" {
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjets",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ${origin_access_identity}"
},
"Action": ["s3:GetObject"],
provider "aws" {
access_key = "xxxxxxxxxxxxxxx"
secret_key = "yyyyyyyyyyyyyyyyyyyyy"
region = "us-west-2"
}
resource "aws_iam_role" "test_role" {
name = "TenableIO"
assume_role_policy = <<EOF
# /usr/bin/python2.7
import boto.ec2
import sys
# specify AWS keys
auth = {"aws_access_key_id": "<key_id>", "aws_secret_access_key": "<access_key>"}
def main():
# read arguments from the command line and
#!/bin/bash
AWS_ACCOUNT_ID="xxxxxxxxxxxxxx"
aws configure set default.region us-east-1
# Login AWS Docker registry
eval $(aws ecr get-login --no-include-email)