Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8e3e603

Browse files
committedJul 2, 2018
docs: improve stack examples
1 parent 53d10fa commit 8e3e603

File tree

1 file changed

+54
-7
lines changed

1 file changed

+54
-7
lines changed
 

‎docs/config.rst

+54-7
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,20 @@ External Stack Configuration
367367
:name: stack-config-external
368368

369369

370-
Stacks Example
371-
~~~~~~~~~~~~~~
370+
Examples
371+
~~~~~~~~
372+
373+
VPC + Instances
374+
:::::::::::::::
375+
376+
Here's an example from stacker_blueprints_, used to create a VPC and and two EC2
377+
Instances::
372378

373-
Here's an example from stacker_blueprints_, used to create a VPC::
374379

380+
namespace: example
375381
stacks:
376-
- name: vpc-example
382+
- name: vpc
383+
stack_name: test-vpc
377384
class_path: stacker_blueprints.vpc.VPC
378385
locked: false
379386
enabled: true
@@ -393,9 +400,49 @@ Here's an example from stacker_blueprints_, used to create a VPC::
393400
- 10.128.16.0/22
394401
- 10.128.20.0/22
395402
CidrBlock: 10.128.0.0/16
396-
- name: external-vpc-example
397-
stack_name: my-dev-account-vpc
398-
profile: dev
403+
404+
- name: instances
405+
stack_name:
406+
class_path: stacker_blueprints.ec2.Instances
407+
enabled: true
408+
variables:
409+
SmallInstance:
410+
InstanceType: t2.small
411+
ImageId: &amazon_linux_ami "${ami owners:amazon name_regex:amzn-ami-hvm-2018.03.*-x86_64-gp2}"
412+
AvailabilityZone: ${output vpc::AvailabilityZone0}
413+
SubnetId: ${output vpc::PublicSubnet0}
414+
LargeInstance:
415+
InstanceType: m5.xlarge
416+
ImageId: *amazon_linux_ami
417+
AvailabilityZone: ${output vpc::AvailabilityZone1}
418+
SubnetId: ${output vpc::PublicSubnet1}
419+
420+
421+
Referencing External Stacks
422+
:::::::::::::::::::::::::::
423+
424+
This example creates a security group in VPC from the previous example by
425+
importing it as an external stack with a custom profile::
426+
427+
namespace: other-example
428+
stacks:
429+
- name: vpc
430+
fqn: example-test-vpc
431+
profile: custom-profile
432+
external: yes
433+
434+
- name: sg
435+
class_path: stacker_blueprints.ec2.SecurityGroups
436+
variables:
437+
SecurityGroups:
438+
VpcId: ${output vpc::VpcId}
439+
SecurityGroupIngress:
440+
- CidrIp: 0.0.0.0/0
441+
FromPort: 22
442+
ToPort: 22
443+
IpProtocol: tcp
444+
445+
399446

400447
Variables
401448
=========

0 commit comments

Comments
 (0)
Please sign in to comment.