@@ -367,13 +367,20 @@ External Stack Configuration
367
367
:name: stack-config-external
368
368
369
369
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::
372
378
373
- Here's an example from stacker_blueprints _, used to create a VPC::
374
379
380
+ namespace: example
375
381
stacks:
376
- - name: vpc-example
382
+ - name: vpc
383
+ stack_name: test-vpc
377
384
class_path: stacker_blueprints.vpc.VPC
378
385
locked: false
379
386
enabled: true
@@ -393,9 +400,49 @@ Here's an example from stacker_blueprints_, used to create a VPC::
393
400
- 10.128.16.0/22
394
401
- 10.128.20.0/22
395
402
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
+
399
446
400
447
Variables
401
448
=========
0 commit comments