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 "aws_iam_policy_document" "data" { | |
enabled = terraform.workspace == "production" | |
statement { | |
actions = [ | |
"s3:GetBucketLocation", | |
"s3:ListBucket", | |
] | |
resources = [ |
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 "aws_iam_policy_document" "data" { | |
count = terraform.workspace == "production" ? 1 : 0 | |
statement { | |
actions = [ | |
"s3:GetBucketLocation", | |
"s3:ListBucket", | |
] | |
resources = [ |
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_instance" "server" { | |
count = 4 # create four similar EC2 instances | |
ami = "ami-a1b2c3d4" | |
instance_type = "t2.micro" | |
tags = { | |
Name = "Server ${count.index}" | |
} | |
} |
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 "aws_s3_bucket" "widget_data" { | |
name = "acmecorp_widget_data" | |
} |
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
module GoogleApi | |
# Inspired by http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html | |
require 'rest-client' | |
require 'active_support' | |
# Google Affiliate Network | |
class GAN | |
# These values obtained from https://code.google.com/apis/console, creating a client ID for Installed Applications | |
CLIENT_ID = '<your-value>.apps.googleusercontent.com' | |
CLIENT_SECRET = '<your-value>' |