@@ -19,7 +19,7 @@ type StackSources interface {
19
19
20
20
// CreateAndUpload packages and uploads the specified Terraform Stacks
21
21
// configuration files in association with a Stack.
22
- CreateAndUpload (ctx context.Context , stackID string , path string ) (* StackSource , error )
22
+ CreateAndUpload (ctx context.Context , stackID string , path string , opts * CreateStackSourceOptions ) (* StackSource , error )
23
23
24
24
// UploadTarGzip is used to upload Terraform configuration files contained a tar gzip archive.
25
25
// Any stream implementing io.Reader can be passed into this method. This method is also
@@ -30,6 +30,10 @@ type StackSources interface {
30
30
UploadTarGzip (ctx context.Context , uploadURL string , archive io.Reader ) error
31
31
}
32
32
33
+ type CreateStackSourceOptions struct {
34
+ SelectedDeployments []string `jsonapi:"attr,selected-deployments,omitempty"`
35
+ }
36
+
33
37
var _ StackSources = (* stackSources )(nil )
34
38
35
39
type stackSources struct {
@@ -63,9 +67,12 @@ func (s *stackSources) Read(ctx context.Context, stackSourceID string) (*StackSo
63
67
64
68
// CreateAndUpload packages and uploads the specified Terraform Stacks
65
69
// configuration files in association with a Stack.
66
- func (s * stackSources ) CreateAndUpload (ctx context.Context , stackID , path string ) (* StackSource , error ) {
70
+ func (s * stackSources ) CreateAndUpload (ctx context.Context , stackID , path string , opts * CreateStackSourceOptions ) (* StackSource , error ) {
71
+ if opts == nil {
72
+ opts = & CreateStackSourceOptions {}
73
+ }
67
74
u := fmt .Sprintf ("stacks/%s/stack-sources" , url .PathEscape (stackID ))
68
- req , err := s .client .NewRequest ("POST" , u , nil )
75
+ req , err := s .client .NewRequest ("POST" , u , opts )
69
76
if err != nil {
70
77
return nil , err
71
78
}
0 commit comments