Skip to content
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ go.work
.vscode/
main
rain
parse-perf
local/
.idea

Expand Down
2 changes: 1 addition & 1 deletion cft/graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ func (g *Graph) String() string {
out := strings.Builder{}

for _, left := range g.order {
out.WriteString(fmt.Sprintf("%s:\n", left))
if len(g.nodes[left]) > 0 {
out.WriteString(fmt.Sprintf("%s:\n", left))
for right := range g.nodes[left] {
out.WriteString(fmt.Sprintf("- %s\n", right))
}
Expand Down
6 changes: 5 additions & 1 deletion cft/graph/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ Parameters:
Resources:
Bucket:
Type: AWS::S3::Bucket
DependsOn: LogBucket
Properties:
BucketName: !Ref Name
Tags:
- Key: Account
- Value: !Ref AWS::AccountId
LogBucket:
Type: AWS::S3::Bucket
Outputs:
BucketName:
Value: !Ref Bucket
Expand Down Expand Up @@ -52,6 +55,7 @@ func Example_nodes() {
// Output:
// Parameters/AWS::AccountId
// Parameters/Name
// Resources/LogBucket
// Resources/Bucket
// Outputs/BucketArn
// Outputs/BucketName
Expand All @@ -63,7 +67,7 @@ func Example_get() {
fmt.Println(g.Get(graph.Node{"Outputs", "BucketName"}))
// Output:
// []
// [Parameters/AWS::AccountId Parameters/Name]
// [Parameters/AWS::AccountId Parameters/Name Resources/LogBucket]
// [Resources/Bucket]
}

Expand Down
13 changes: 13 additions & 0 deletions cft/graph/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"regexp"
"strings"

"github.com/aws-cloudformation/rain/internal/config"
)

var subRe = regexp.MustCompile(`\$\{([^!].+?)\}`)
Expand All @@ -17,6 +19,17 @@ func findRefs(t map[string]interface{}) []string {

for key, value := range t {
switch key {
case "DependsOn":
switch v := value.(type) {
case string:
refs = append(refs, v)
case []interface{}:
for _, d := range v {
refs = append(refs, d.(string))
}
default:
config.Debugf("invalid DependsOn: %v, %v", key, value)
}
case "Ref":
refs = append(refs, value.(string))
case "Fn::GetAtt":
Expand Down
4 changes: 4 additions & 0 deletions internal/cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ YAML:
panic(err)
}

// Figure out how long we thing the stack will take to execute
//totalSeconds := forecast.PredictTotalEstimate(template, stackExists)
// TODO - Wait until the forecast command is GA and add this to output

// Create change set
spinner.Push("Creating change set")
changeSetName, createErr := cfn.CreateChangeSet(template, dc.Params, dc.Tags, stackName, roleArn)
Expand Down
Loading