SlideShare a Scribd company logo
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Beyond theBasics:Advanced Infrastructure as
CodeProgramming onAWS
Luis Colon
Senior Developer Advocate
AWS CloudFormation
D E V 3 2 7
Chuck Meyer
Senior Developer Advocate
AWS CloudFormation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
Deep Dive:
AWS CloudFormation
Macros
Declarative vs
Imperative
Coding
d i
Deep Dive:
Imperative
AWS CloudFormation
Programming Options Overview
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DeclarativeProgramming
DECLARATIVE:
Saying what you want
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DeclarativevsImperative
• Barrier of entry is low
• Less knowledge required than with higher level
languages, toolchains
• Limitations
• Full execution control, looping constructs,
advanced techniques (OO inheritance,
threading, automated testing, etc.)
• Barrier of entry is higher
• Expects authors to know the language
syntax, different API libraries and
conventions, properly catching exceptions
• Added flexibility
• Language-specific editors and tooling
designed to improve coder productivity
DECLARATIVE:
Saying what you want
IMPERATIVE
Saying how to to do it
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CFN:DeclarativeProgramming
• YAML, JSON are used to
“declare” the desired state
• Mostly, we are not telling
AWS CloudFormation
explicitly how to do things;
rather, what we want the
desired state of our
resources to be
• I want my original desired
capacity in my ASG cluster
to be 4. If I change it to 6,
AWS CloudFormation will
create 2 more to meet my
desired state
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Someimperativeprogramming ispossible
• Amazon Elastic Compute Cloud (Amazon EC2) UserData – We are asking to run several commands
• Functions like Fn::Condition, Fn::FindInMap, etc. give imperative instructions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudFormation Programming Options
• Basic YAML/JSON
• Basic Transforms
• Include
• SAM
• Advanced Transforms
• Macros
• others: Jinja/Mustache
• CDK (TypeScript)
• Troposphere (Python)
• SparkleFormation (Ruby)
• GoFormation (GoLang)
• …
DECLARATIVE: IMPERATIVE
• In all cases, we are still generating YAML/JSON vs direct API calls
• Leverage stabilization, dependency graphs, rollbacks, etc.
Deep Dive: Macros
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Macros
Write short-hand, abbreviated instructions that expand automatically when deployed
Add utility functions, for example, iteration loops, strings, etc.
Ensure resources are defined to comply to your standards
Easy to share and reuse across stacks
Key Benefit: once macros are deployed, downstream Macro users can be isolated
from all imperative programming details
Macros are AWS Lambda functions - use any of the supported Lambda languages
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Let’sseesomemacroexamples
Iterator/Loop
• Make me X number of this resource
Execute Python
• Pass arbitrary code
Perform String Functions
• Upper, Lower, …
Globals
• Add Global Variables
Defaults
• If resource X is declared, add default attributes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Iterator: Code
import copy
def process_template(template):
new_template = copy.deepcopy(template)
status = 'success'
for name, resource in template['Resources'].items():
if 'Count' in resource:
count = new_template['Resources'][name].pop('Count')
multiplied = multiply(name, new_template['Resources'][name], count)
if not set(multiplied.keys()) & set(new_template['Resources'].keys()):
new_template['Resources'].update(multiplied)
else:
status = 'failed'
return status, template
return status, new_template
def multiply(resource_name, resource_structure, count):
resources = {}
for iteration in range(1, count):
resources[resource_name+str(iteration)] = resource_structure
return resources
def handler(event, context):
result = process_template(event['fragment'])
return {
'requestId': event['requestId'],
'status': result[0],
'fragment': result[1],
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Iterator: Deploythemacro
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
Macro:
Type: AWS::CloudFormation::Macro
Properties:
Name: Count
FunctionName: !GetAtt CountMacroFunction.Arn
CountMacroFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src
Handler: index.handler
Runtime: python3.6
Timeout: 5
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Iterator: Usingyourmacro
Transform:
- Count
Resources:
Bucket:
Type: AWS::S3::Bucket
Count: 3
Transform:
- Count
Sqs:
Type: AWS:::SQS::Queue
Count: 2
Resources:
Bucket1:
Type: AWS::S3::Bucket
Bucket2:
Type: AWS::S3::Bucket
Bucket3:
Type: AWS::S3::Bucket
Resources:
Sqs1:
Type: AWS:::SQS::Queue
Sqs2:
Type: AWS:::SQS::Queue
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
def handler(event, context):
macro_response = {
"requestId": event["requestId"],
"status": "success"
}
try:
params = {
"params": event["templateParameterValues"],
"template": event["fragment"],
"account_id": event["accountId"],
"region": event["region"]
}
response = event["fragment"]
macro_response["fragment"] =
obj_iterate(response, params)
except Exception as e:
traceback.print_exc()
macro_response["status"] = "failure"
macro_response["errorMessage"] = str(e)
return macro_response
Macro:Execute Python
AWSTemplateFormatVersion: "2010-09-09"
Description: tests String macro functions
Parameters:
Tags:
Default:
"Env=Prod,Application=MyApp,BU=ModernisationTeam"
Type: "CommaDelimitedList"
Resources:
S3Bucket:
Type: "AWS::S3::Bucket"
Properties:
Tags: |
#!PyPlate
output = []
for tag in params['Tags']:
key, value = tag.split('=')
output.append({"Key": key, "Value": value})
Transform: [PyPlate]
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Macro:AddStringFunctions
Parameters:
InputString:
Default: "This is a test input string"
Type: String
Resources:
S3Bucket:
Type: "AWS::S3::Bucket"
Properties:
Tags:
- Key: Upper
Value:
'Fn::Transform':
- Name: 'StringMacro'
Parameters:
InputString: !Ref InputString
Operation: Upper
Parameters:
InputString:
Default: "This is a test input string"
Type: String
Resources:
S3Bucket:
Type: "AWS::S3::Bucket"
Properties:
Tags:
- Key: Upper
Value: “THIS IS A TEST INPUT STRING”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Code:AddStringFunctionsdef handler(event, context):
response = {
"requestId": event["requestId"],
"status": "success"
}
try:
operation = event["params"]["Operation"]
input = event["params"]["InputString"]
no_param_string_funcs = [
"Upper", "Lower", "Capitalize",
"Title", "SwapCase"]
if operation in no_param_string_funcs:
…
elif operation == "Strip":
…
elif operation == "Replace":
…
elif operation == "MaxLength":
…
except Exception:
traceback.print_exc()
response["status"] = "failure"
macro_response["errorMessage"] = str(e)
return response
Multiple Functions in a single macro:
• Upper
• Lower
• Capitalize
• Title
• SwapCase
• Strip
• Replace
• MaxLength
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Macro:GlobalVariables
Transform: Globals
Globals:
SomeText: some-text
ThingTag:
Key: Thing
Value: This is a thing
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: "@SomeText"
Tags:
- "@ThingTag"
- Key: OtherThing
Value: Other thing value
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: “some-text"
Tags:
- Key: Thing
Value: This is a thing
- Key: OtherThing
Value: Other thing value
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Code:Globals
class Repeater():
def __init__(self, template):
self.repeaters = template["Globals"]
del template["Globals"]
self.template = template
def process(self):
return self.__walk(self.template)
def __walk(self, fragment):
if isinstance(fragment, str) and any(fragment == "@{}".format(key)
for key in self.repeaters):
return self.repeaters[fragment[1:]]
elif isinstance(fragment, dict):
return {
key: self.__walk(value)
for key, value
in fragment.items()
}
elif isinstance(fragment, list):
return [
self.__walk(value)
for value in fragment
]
return fragment
def handler(event, context):
return {
"requestId": event["requestId"],
"status": "success",
"fragment": Repeater(event["fragment"]).process(),
}
Transform: Globals
Globals:
SomeText: some-text
ThingTag:
Key: Thing
Value: This is a thing
Resources:
Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: "@SomeText"
Tags:
- "@ThingTag"
- Key: OtherThing
Value: Other thing value
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Macro:Generate Additional Resources
Transform: Defaults
Resources:
Bucket1:
Type: AWS::S3::Bucket
Resources:
Bucket1:
Type: AWS::S3::Bucket
Properties:
AccessControl: Private
Bucket1Policy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: Bucket1
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Deny
Principal: "*"
Action: "s3:Delete*"
Resource:
Fn::Sub:
"arn:aws:s3:::${Bucket1}/*"
Condition:
Bool:
aws:MultiFactorAuthPresent:
"false"
Whenever a bucket is defined…
• Add access control property
• Add bucket policy
• Generate additional resources, intrinsic function
calls, conditions, more
• Macro can allow user to override defaults
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Advanced:SettingupDefaults
DEFAULTS = json.load(open("defaults.json"))
def interpolate(name, string):
return string.replace("{$}", name)
def get_additional_resources(name, props):
additional_resources = {}
for key, value in props.items():
key = interpolate(name, key)
if isinstance(value, dict):
additional_resources[key] = get_additional_resources(name, value)
elif isinstance(value, list):
additional_resources[key] = [
get_additional_resources(name, v)
for v in value
]
elif isinstance(value, str):
additional_resources[key] = interpolate(name, value)
else:
additional_resources[key] = value
return additional_resources
def process_property(key, default, resource):
# Recursive
prop = resource[key]
if isinstance(prop, dict):
if "Defaults::Override" in prop:
resource[key] = prop["Defaults::Override"]
else:
resource[key] = default
elif isinstance(default, dict):
for k in default.keys():
if k in prop.keys():
process_property(k, default[k], prop)
else:
prop[k] = default[k]
else:
resource[key] = default
def process_resource(name, resource, additional_resources):
default = DEFAULTS[resource["Type"]]
if "Properties" not in resource:
resource["Properties"] = {}
# Handle properties
for key, prop in default["Properties"].items():
if key not in resource["Properties"]:
resource["Properties"][key] = prop
else:
process_property(key, prop, resource["Properties"])
# Add additional resources
additional_resources.update(get_additional_resources(name,
default.get("AdditionalResources", {})))
def process(template):
additional_resources = {}
for name, resource in template["Resources"].items():
if resource["Type"] in DEFAULTS:
process_resource(name, resource, additional_resources)
template["Resources"].update(additional_resources)
return template
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Advanced:SettingupDefaults
{
"AWS::S3::Bucket": {
"Properties": {
"AccessControl": "Private",
"VersioningConfiguration": {
"Status": "Enabled"
}
},
"AdditionalResources": {
"{$}Policy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": {
"Ref": "{$}"
},
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": "s3:Delete*",
"Resource": {
"Fn::Sub": "arn:aws:s3:::${{$}}/*"
},
"Condition": {
"Bool": {
"aws:MultiFactorAuthPresent": "false"
}
…
Specify additional resources in a side file
Imperative Programming in AWS
CloudFormation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ImperativeProgramming Options
• AWS Cloud Development Kit (Developer Preview)
• Modeling infrastructure programmatically
• Componentized
• Python
• Troposphere
• Mature project on GitHub
• Generates both YAML and JSON
• Other Options
• Ruby: SparkleFormation
• JS/TypeScript: CloudForm
• … many others
• All of these still generate YAML/JSON code
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWSCDK(Cloud DevelopmentKit)inDevPreview
CDK Application
Stack(s)
Construct(s)
CDK
CLI
AWS CloudFormation
Templates“compiler”
“assembly
language”
“processor”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWSCDK
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWSSDK
One of the three primary ways to
operate AWS
Console, CLI, APIs
AWS SDK for Python (boto)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Troposphere
Requires Boto3
Generates YAML/JSON
from troposphere import Ref, Template
import troposphere.ec2 as ec2
template = Template()
envs = ['dev', 'test', 'prod']
for x in envs:
instanceName = x + "Ec2"
ec2_instance = template.add_resource(ec2.Instance(
instanceName,
ImageId="ami-a7a242da",
InstanceType="t2.nano",
))
fh = open("template.yaml", "a")
fh.writelines(template.to_yaml())
fh.close()
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
WrapUp
Many macro possibilities:
Iterators, Python, string
functions
global variables, defaults…
Other possibilities:
Cloning resources,
generating pipelines …
Use one, or the other, or both
Macros are a good tool to
balance the declarative
nature
of AWS CloudFormation,
without requiring template
authors to have imperative
code
d i
Imperative Programming
CDK and components
Troposphere
Many additional languages
Still leverage AWS
CloudFormation benefits
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Luis Colon
Senior Developer Advocate
AWS CloudFormation
Chuck Meyer
Senior Developer Advocate
AWS CloudFormation
Please complete the session
survey in the mobile app.
!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Amazon Web Services
 
Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:In...
Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:In...Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:In...
Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:In...
Amazon Web Services
 
Mythical Mysfits: Management and Ops with AWS Fargate (CON322-R1) - AWS re:In...
Mythical Mysfits: Management and Ops with AWS Fargate (CON322-R1) - AWS re:In...Mythical Mysfits: Management and Ops with AWS Fargate (CON322-R1) - AWS re:In...
Mythical Mysfits: Management and Ops with AWS Fargate (CON322-R1) - AWS re:In...
Amazon Web Services
 
Accelerating Application Development with Amazon Aurora (DAT312-R2) - AWS re:...
Accelerating Application Development with Amazon Aurora (DAT312-R2) - AWS re:...Accelerating Application Development with Amazon Aurora (DAT312-R2) - AWS re:...
Accelerating Application Development with Amazon Aurora (DAT312-R2) - AWS re:...
Amazon Web Services
 
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
Amazon Web Services
 
Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
Amazon Web Services
 
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
Amazon Web Services
 
Improve Consistency & Governance in Cross-Account & Global Deployments (DEV34...
Improve Consistency & Governance in Cross-Account & Global Deployments (DEV34...Improve Consistency & Governance in Cross-Account & Global Deployments (DEV34...
Improve Consistency & Governance in Cross-Account & Global Deployments (DEV34...
Amazon Web Services
 
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
Amazon Web Services
 
Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS...
Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS...Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS...
Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS...
Amazon Web Services
 
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...
Amazon Web Services
 
Container Scheduling
Container SchedulingContainer Scheduling
Container Scheduling
Amazon Web Services
 
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Amazon Web Services
 
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Amazon Web Services
 
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Amazon Web Services
 
Reserve Amazon EC2 On-Demand Capacity for Any Duration with On-Demand Capacit...
Reserve Amazon EC2 On-Demand Capacity for Any Duration with On-Demand Capacit...Reserve Amazon EC2 On-Demand Capacity for Any Duration with On-Demand Capacit...
Reserve Amazon EC2 On-Demand Capacity for Any Duration with On-Demand Capacit...
Amazon Web Services
 
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
Amazon Web Services
 
Architecture Patterns for Multi-Region Active-Active Applications (ARC209-R2)...
Architecture Patterns for Multi-Region Active-Active Applications (ARC209-R2)...Architecture Patterns for Multi-Region Active-Active Applications (ARC209-R2)...
Architecture Patterns for Multi-Region Active-Active Applications (ARC209-R2)...
Amazon Web Services
 
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
Amazon Web Services
 
Amazon VPC: Security at the Speed Of Light (NET313) - AWS re:Invent 2018
Amazon VPC: Security at the Speed Of Light (NET313) - AWS re:Invent 2018Amazon VPC: Security at the Speed Of Light (NET313) - AWS re:Invent 2018
Amazon VPC: Security at the Speed Of Light (NET313) - AWS re:Invent 2018
Amazon Web Services
 

What's hot (20)

Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
 
Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:In...
Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:In...Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:In...
Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:In...
 
Mythical Mysfits: Management and Ops with AWS Fargate (CON322-R1) - AWS re:In...
Mythical Mysfits: Management and Ops with AWS Fargate (CON322-R1) - AWS re:In...Mythical Mysfits: Management and Ops with AWS Fargate (CON322-R1) - AWS re:In...
Mythical Mysfits: Management and Ops with AWS Fargate (CON322-R1) - AWS re:In...
 
Accelerating Application Development with Amazon Aurora (DAT312-R2) - AWS re:...
Accelerating Application Development with Amazon Aurora (DAT312-R2) - AWS re:...Accelerating Application Development with Amazon Aurora (DAT312-R2) - AWS re:...
Accelerating Application Development with Amazon Aurora (DAT312-R2) - AWS re:...
 
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
 
Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
 
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
以 Amazon EC2 Spot 執行個體有效控制專案成本 (Level: 200)
 
Improve Consistency & Governance in Cross-Account & Global Deployments (DEV34...
Improve Consistency & Governance in Cross-Account & Global Deployments (DEV34...Improve Consistency & Governance in Cross-Account & Global Deployments (DEV34...
Improve Consistency & Governance in Cross-Account & Global Deployments (DEV34...
 
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
How to Use Predictive Scaling (API331-R1) - AWS re:Invent 2018
 
Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS...
Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS...Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS...
Amazon Prime Video: Delivering the Amazing Video Experience (CTD203-R1) - AWS...
 
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...
Infrastructure Is Code with the AWS Cloud Development Kit (DEV372) - AWS re:I...
 
Container Scheduling
Container SchedulingContainer Scheduling
Container Scheduling
 
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
 
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
Enterprise Network Transformation Powered by OrangeX, with Nokia Nuage and AW...
 
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
 
Reserve Amazon EC2 On-Demand Capacity for Any Duration with On-Demand Capacit...
Reserve Amazon EC2 On-Demand Capacity for Any Duration with On-Demand Capacit...Reserve Amazon EC2 On-Demand Capacity for Any Duration with On-Demand Capacit...
Reserve Amazon EC2 On-Demand Capacity for Any Duration with On-Demand Capacit...
 
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
A Deep Dive into What's New with Amazon EMR (ANT340-R1) - AWS re:Invent 2018
 
Architecture Patterns for Multi-Region Active-Active Applications (ARC209-R2)...
Architecture Patterns for Multi-Region Active-Active Applications (ARC209-R2)...Architecture Patterns for Multi-Region Active-Active Applications (ARC209-R2)...
Architecture Patterns for Multi-Region Active-Active Applications (ARC209-R2)...
 
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
[NEW LAUNCH!] Introducing Amazon Elastic Inference: Reduce Deep Learning Infe...
 
Amazon VPC: Security at the Speed Of Light (NET313) - AWS re:Invent 2018
Amazon VPC: Security at the Speed Of Light (NET313) - AWS re:Invent 2018Amazon VPC: Security at the Speed Of Light (NET313) - AWS re:Invent 2018
Amazon VPC: Security at the Speed Of Light (NET313) - AWS re:Invent 2018
 

Similar to Beyond the Basics: Advanced Infrastructure as Code Programming on AWS (DEV327-R1) - AWS re:Invent 2018

AWS CloudFormation macros: Coding best practices - MAD201 - New York AWS Summit
AWS CloudFormation macros: Coding best practices - MAD201 - New York AWS SummitAWS CloudFormation macros: Coding best practices - MAD201 - New York AWS Summit
AWS CloudFormation macros: Coding best practices - MAD201 - New York AWS Summit
Amazon Web Services
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
Amazon Web Services
 
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Amazon Web Services
 
The Best Practices and Hard Lessons Learned of Serverless Applications
The Best Practices and Hard Lessons Learned of Serverless ApplicationsThe Best Practices and Hard Lessons Learned of Serverless Applications
The Best Practices and Hard Lessons Learned of Serverless Applications
Amazon Web Services LATAM
 
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
Amazon Web Services
 
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Amazon Web Services
 
Introduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOSIntroduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOS
Amazon Web Services
 
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Amazon Web Services
 
Building Serverless ETL Pipelines
Building Serverless ETL PipelinesBuilding Serverless ETL Pipelines
Building Serverless ETL Pipelines
Amazon Web Services
 
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
Amazon Web Services
 
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
Amazon Web Services
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
Chris Munns
 
Devops on serverless
Devops on serverlessDevops on serverless
Devops on serverless
Sébastien ☁ Stormacq
 
Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM
Amazon Web Services
 
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
Amazon Web Services
 
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Amazon Web Services
 
2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless
2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless
2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless
Kim Kao
 
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
Amazon Web Services
 
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Amazon Web Services
 
CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018
CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018
CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018
Martijn van Dongen
 

Similar to Beyond the Basics: Advanced Infrastructure as Code Programming on AWS (DEV327-R1) - AWS re:Invent 2018 (20)

AWS CloudFormation macros: Coding best practices - MAD201 - New York AWS Summit
AWS CloudFormation macros: Coding best practices - MAD201 - New York AWS SummitAWS CloudFormation macros: Coding best practices - MAD201 - New York AWS Summit
AWS CloudFormation macros: Coding best practices - MAD201 - New York AWS Summit
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
Running Serverless at The Edge (CTD302) - AWS re:Invent 2018
 
The Best Practices and Hard Lessons Learned of Serverless Applications
The Best Practices and Hard Lessons Learned of Serverless ApplicationsThe Best Practices and Hard Lessons Learned of Serverless Applications
The Best Practices and Hard Lessons Learned of Serverless Applications
 
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
 
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
Hands-On with Advanced AWS CloudFormation Techniques and New Features (DEV335...
 
Introduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOSIntroduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOS
 
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
Best Practices and Hard Lessons of Serverless- AWS Startup Day Toronto- Diego...
 
Building Serverless ETL Pipelines
Building Serverless ETL PipelinesBuilding Serverless ETL Pipelines
Building Serverless ETL Pipelines
 
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
AWS18 Startup Day Toronto- The Best Practices and Hard Lessons Learned of Ser...
 
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
The Best Practices and Hard Lessons Learned of Serverless Applications - AWS ...
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
 
Devops on serverless
Devops on serverlessDevops on serverless
Devops on serverless
 
Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM
 
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
 
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
Building Serverless Applications Using AWS AppSync and Amazon Neptune (SRV307...
 
2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless
2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless
2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless
 
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
Simpler by Design: Build a Better GraphQL API for Your Next App by Writing Le...
 
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
 
CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018
CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018
CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
Amazon Web Services
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
Amazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Amazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
Amazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Amazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Beyond the Basics: Advanced Infrastructure as Code Programming on AWS (DEV327-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Beyond theBasics:Advanced Infrastructure as CodeProgramming onAWS Luis Colon Senior Developer Advocate AWS CloudFormation D E V 3 2 7 Chuck Meyer Senior Developer Advocate AWS CloudFormation
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda Deep Dive: AWS CloudFormation Macros Declarative vs Imperative Coding d i Deep Dive: Imperative AWS CloudFormation
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. DeclarativeProgramming DECLARATIVE: Saying what you want
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. DeclarativevsImperative • Barrier of entry is low • Less knowledge required than with higher level languages, toolchains • Limitations • Full execution control, looping constructs, advanced techniques (OO inheritance, threading, automated testing, etc.) • Barrier of entry is higher • Expects authors to know the language syntax, different API libraries and conventions, properly catching exceptions • Added flexibility • Language-specific editors and tooling designed to improve coder productivity DECLARATIVE: Saying what you want IMPERATIVE Saying how to to do it
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CFN:DeclarativeProgramming • YAML, JSON are used to “declare” the desired state • Mostly, we are not telling AWS CloudFormation explicitly how to do things; rather, what we want the desired state of our resources to be • I want my original desired capacity in my ASG cluster to be 4. If I change it to 6, AWS CloudFormation will create 2 more to meet my desired state
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Someimperativeprogramming ispossible • Amazon Elastic Compute Cloud (Amazon EC2) UserData – We are asking to run several commands • Functions like Fn::Condition, Fn::FindInMap, etc. give imperative instructions
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CloudFormation Programming Options • Basic YAML/JSON • Basic Transforms • Include • SAM • Advanced Transforms • Macros • others: Jinja/Mustache • CDK (TypeScript) • Troposphere (Python) • SparkleFormation (Ruby) • GoFormation (GoLang) • … DECLARATIVE: IMPERATIVE • In all cases, we are still generating YAML/JSON vs direct API calls • Leverage stabilization, dependency graphs, rollbacks, etc.
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Macros Write short-hand, abbreviated instructions that expand automatically when deployed Add utility functions, for example, iteration loops, strings, etc. Ensure resources are defined to comply to your standards Easy to share and reuse across stacks Key Benefit: once macros are deployed, downstream Macro users can be isolated from all imperative programming details Macros are AWS Lambda functions - use any of the supported Lambda languages
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Let’sseesomemacroexamples Iterator/Loop • Make me X number of this resource Execute Python • Pass arbitrary code Perform String Functions • Upper, Lower, … Globals • Add Global Variables Defaults • If resource X is declared, add default attributes
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Iterator: Code import copy def process_template(template): new_template = copy.deepcopy(template) status = 'success' for name, resource in template['Resources'].items(): if 'Count' in resource: count = new_template['Resources'][name].pop('Count') multiplied = multiply(name, new_template['Resources'][name], count) if not set(multiplied.keys()) & set(new_template['Resources'].keys()): new_template['Resources'].update(multiplied) else: status = 'failed' return status, template return status, new_template def multiply(resource_name, resource_structure, count): resources = {} for iteration in range(1, count): resources[resource_name+str(iteration)] = resource_structure return resources def handler(event, context): result = process_template(event['fragment']) return { 'requestId': event['requestId'], 'status': result[0], 'fragment': result[1], }
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Iterator: Deploythemacro AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: Macro: Type: AWS::CloudFormation::Macro Properties: Name: Count FunctionName: !GetAtt CountMacroFunction.Arn CountMacroFunction: Type: AWS::Serverless::Function Properties: CodeUri: src Handler: index.handler Runtime: python3.6 Timeout: 5
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Iterator: Usingyourmacro Transform: - Count Resources: Bucket: Type: AWS::S3::Bucket Count: 3 Transform: - Count Sqs: Type: AWS:::SQS::Queue Count: 2 Resources: Bucket1: Type: AWS::S3::Bucket Bucket2: Type: AWS::S3::Bucket Bucket3: Type: AWS::S3::Bucket Resources: Sqs1: Type: AWS:::SQS::Queue Sqs2: Type: AWS:::SQS::Queue
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. def handler(event, context): macro_response = { "requestId": event["requestId"], "status": "success" } try: params = { "params": event["templateParameterValues"], "template": event["fragment"], "account_id": event["accountId"], "region": event["region"] } response = event["fragment"] macro_response["fragment"] = obj_iterate(response, params) except Exception as e: traceback.print_exc() macro_response["status"] = "failure" macro_response["errorMessage"] = str(e) return macro_response Macro:Execute Python AWSTemplateFormatVersion: "2010-09-09" Description: tests String macro functions Parameters: Tags: Default: "Env=Prod,Application=MyApp,BU=ModernisationTeam" Type: "CommaDelimitedList" Resources: S3Bucket: Type: "AWS::S3::Bucket" Properties: Tags: | #!PyPlate output = [] for tag in params['Tags']: key, value = tag.split('=') output.append({"Key": key, "Value": value}) Transform: [PyPlate]
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Macro:AddStringFunctions Parameters: InputString: Default: "This is a test input string" Type: String Resources: S3Bucket: Type: "AWS::S3::Bucket" Properties: Tags: - Key: Upper Value: 'Fn::Transform': - Name: 'StringMacro' Parameters: InputString: !Ref InputString Operation: Upper Parameters: InputString: Default: "This is a test input string" Type: String Resources: S3Bucket: Type: "AWS::S3::Bucket" Properties: Tags: - Key: Upper Value: “THIS IS A TEST INPUT STRING”
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Code:AddStringFunctionsdef handler(event, context): response = { "requestId": event["requestId"], "status": "success" } try: operation = event["params"]["Operation"] input = event["params"]["InputString"] no_param_string_funcs = [ "Upper", "Lower", "Capitalize", "Title", "SwapCase"] if operation in no_param_string_funcs: … elif operation == "Strip": … elif operation == "Replace": … elif operation == "MaxLength": … except Exception: traceback.print_exc() response["status"] = "failure" macro_response["errorMessage"] = str(e) return response Multiple Functions in a single macro: • Upper • Lower • Capitalize • Title • SwapCase • Strip • Replace • MaxLength
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Macro:GlobalVariables Transform: Globals Globals: SomeText: some-text ThingTag: Key: Thing Value: This is a thing Resources: Bucket: Type: AWS::S3::Bucket Properties: BucketName: "@SomeText" Tags: - "@ThingTag" - Key: OtherThing Value: Other thing value Resources: Bucket: Type: AWS::S3::Bucket Properties: BucketName: “some-text" Tags: - Key: Thing Value: This is a thing - Key: OtherThing Value: Other thing value
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Code:Globals class Repeater(): def __init__(self, template): self.repeaters = template["Globals"] del template["Globals"] self.template = template def process(self): return self.__walk(self.template) def __walk(self, fragment): if isinstance(fragment, str) and any(fragment == "@{}".format(key) for key in self.repeaters): return self.repeaters[fragment[1:]] elif isinstance(fragment, dict): return { key: self.__walk(value) for key, value in fragment.items() } elif isinstance(fragment, list): return [ self.__walk(value) for value in fragment ] return fragment def handler(event, context): return { "requestId": event["requestId"], "status": "success", "fragment": Repeater(event["fragment"]).process(), } Transform: Globals Globals: SomeText: some-text ThingTag: Key: Thing Value: This is a thing Resources: Bucket: Type: AWS::S3::Bucket Properties: BucketName: "@SomeText" Tags: - "@ThingTag" - Key: OtherThing Value: Other thing value
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Macro:Generate Additional Resources Transform: Defaults Resources: Bucket1: Type: AWS::S3::Bucket Resources: Bucket1: Type: AWS::S3::Bucket Properties: AccessControl: Private Bucket1Policy: Type: AWS::S3::BucketPolicy Properties: Bucket: Ref: Bucket1 PolicyDocument: Version: "2012-10-17" Statement: - Effect: Deny Principal: "*" Action: "s3:Delete*" Resource: Fn::Sub: "arn:aws:s3:::${Bucket1}/*" Condition: Bool: aws:MultiFactorAuthPresent: "false" Whenever a bucket is defined… • Add access control property • Add bucket policy • Generate additional resources, intrinsic function calls, conditions, more • Macro can allow user to override defaults
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Advanced:SettingupDefaults DEFAULTS = json.load(open("defaults.json")) def interpolate(name, string): return string.replace("{$}", name) def get_additional_resources(name, props): additional_resources = {} for key, value in props.items(): key = interpolate(name, key) if isinstance(value, dict): additional_resources[key] = get_additional_resources(name, value) elif isinstance(value, list): additional_resources[key] = [ get_additional_resources(name, v) for v in value ] elif isinstance(value, str): additional_resources[key] = interpolate(name, value) else: additional_resources[key] = value return additional_resources def process_property(key, default, resource): # Recursive prop = resource[key] if isinstance(prop, dict): if "Defaults::Override" in prop: resource[key] = prop["Defaults::Override"] else: resource[key] = default elif isinstance(default, dict): for k in default.keys(): if k in prop.keys(): process_property(k, default[k], prop) else: prop[k] = default[k] else: resource[key] = default def process_resource(name, resource, additional_resources): default = DEFAULTS[resource["Type"]] if "Properties" not in resource: resource["Properties"] = {} # Handle properties for key, prop in default["Properties"].items(): if key not in resource["Properties"]: resource["Properties"][key] = prop else: process_property(key, prop, resource["Properties"]) # Add additional resources additional_resources.update(get_additional_resources(name, default.get("AdditionalResources", {}))) def process(template): additional_resources = {} for name, resource in template["Resources"].items(): if resource["Type"] in DEFAULTS: process_resource(name, resource, additional_resources) template["Resources"].update(additional_resources) return template
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Advanced:SettingupDefaults { "AWS::S3::Bucket": { "Properties": { "AccessControl": "Private", "VersioningConfiguration": { "Status": "Enabled" } }, "AdditionalResources": { "{$}Policy": { "Type": "AWS::S3::BucketPolicy", "Properties": { "Bucket": { "Ref": "{$}" }, "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Principal": "*", "Action": "s3:Delete*", "Resource": { "Fn::Sub": "arn:aws:s3:::${{$}}/*" }, "Condition": { "Bool": { "aws:MultiFactorAuthPresent": "false" } … Specify additional resources in a side file
  • 24. Imperative Programming in AWS CloudFormation
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ImperativeProgramming Options • AWS Cloud Development Kit (Developer Preview) • Modeling infrastructure programmatically • Componentized • Python • Troposphere • Mature project on GitHub • Generates both YAML and JSON • Other Options • Ruby: SparkleFormation • JS/TypeScript: CloudForm • … many others • All of these still generate YAML/JSON code
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWSCDK(Cloud DevelopmentKit)inDevPreview CDK Application Stack(s) Construct(s) CDK CLI AWS CloudFormation Templates“compiler” “assembly language” “processor”
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWSCDK
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWSSDK One of the three primary ways to operate AWS Console, CLI, APIs AWS SDK for Python (boto)
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Troposphere Requires Boto3 Generates YAML/JSON from troposphere import Ref, Template import troposphere.ec2 as ec2 template = Template() envs = ['dev', 'test', 'prod'] for x in envs: instanceName = x + "Ec2" ec2_instance = template.add_resource(ec2.Instance( instanceName, ImageId="ami-a7a242da", InstanceType="t2.nano", )) fh = open("template.yaml", "a") fh.writelines(template.to_yaml()) fh.close()
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo
  • 31.
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. WrapUp Many macro possibilities: Iterators, Python, string functions global variables, defaults… Other possibilities: Cloning resources, generating pipelines … Use one, or the other, or both Macros are a good tool to balance the declarative nature of AWS CloudFormation, without requiring template authors to have imperative code d i Imperative Programming CDK and components Troposphere Many additional languages Still leverage AWS CloudFormation benefits
  • 33. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Luis Colon Senior Developer Advocate AWS CloudFormation Chuck Meyer Senior Developer Advocate AWS CloudFormation
  • 34. Please complete the session survey in the mobile app. ! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.