ezshield / posh-awscfn

PowerShell module to help generate AWS CloudFormation templates
MIT License
12 stars 2 forks source link

Branch 0.10 #5

Open theonlyway opened 7 years ago

theonlyway commented 7 years ago

This may or may not help you since I had to do a bit of reverse engineering to figure out how you were doing stuff so chances are I'm not doing it in alignment with what you want planned for your module. But I finally got some time to come back to this and since I didn't know where you were up to I just decided to create the functionality I needed with the updated schema.

Added

Example export

 Add-CfnOutput -Description 'Exports the ID of the Prod public subnet in 2a' -OutputName ProdPublicSubnetExport2a -Value (Use-CfnRefFunction -LogicalName VPC1Subnet1a) -Export @{
    Name = 'VPC1-ProdPublic2a'
  }

Example import

 Add-CfnAutoScaling_AutoScalingGroupResource -ResourceName PSGalleryASG01 -MinSize 1 -MaxSize 1 -PropertiesBlock {
    Set-CfnResourceProperty -Name LaunchConfigurationName -Value (Use-CfnRefFunction -LogicalName PSGalleryLaunchConfig)  
    Set-CfnResourceProperty -Name VPCZoneIdentifier -Value (Use-CfnImportFunction -Value VPC1-DevPrivate2a),(Use-CfnImportFunction -Value VPC1-DevPrivate2b),(Use-CfnImportFunction -Value VPC1-DevPrivate2c)           
  } -HealthCheckGracePeriod 300 -HealthCheckType EC2