Skip to content

Commit a205692

Browse files
committed
Add support for filtering expected resource types
Add optional resource-types input parameter that allows specifying which AWS resource types the stack update is expected to change. The value is passed to CloudFormation UpdateStack API as ResourceTypes parameter.
1 parent b99d383 commit a205692

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ inputs:
1111
Newline-separated parameters to change in the Name=Value format.
1212
Stack parameters not set here would retain their existing values.
1313
required: true
14+
resource-types:
15+
description: >
16+
Optional newline-separated AWS resource types that stack update is expected to change.
1417
1518
runs:
1619
using: docker

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ func run(ctx context.Context, stackName string, args []string) error {
5252
return errors.New("empty parameters list")
5353
}
5454
debugf("loaded parameters: %v", toReplace)
55+
var resourceTypes []string
56+
if val := os.Getenv("INPUT_RESOURCE-TYPES"); val != "" {
57+
resourceTypes = strings.Split(val, "\n")
58+
}
59+
debugf("resource types: %v", resourceTypes)
5560
cfg, err := config.LoadDefaultConfig(ctx)
5661
if err != nil {
5762
return err
@@ -96,6 +101,7 @@ func run(ctx context.Context, stackName string, args []string) error {
96101
ClientRequestToken: &token,
97102
UsePreviousTemplate: ptr(true),
98103
Parameters: params,
104+
ResourceTypes: resourceTypes,
99105
Capabilities: stack.Capabilities,
100106
NotificationARNs: stack.NotificationARNs,
101107
})

0 commit comments

Comments
 (0)