Skip to content

Commit

Permalink
Adding delete after destroy into deployment settings (#244)
Browse files Browse the repository at this point in the history
### Summary
- Added the parameter into schema, generated SDKs
- Added provider logic to use parameter from schema when calling pulumi
cloud

### Testing
- imported generated .Net SDK into local project
- verified in console that `pulumi up` created DeploymentSettings with
the `deleteAfterDestroy` flag as expected
  • Loading branch information
IaroslavTitov authored Apr 15, 2024
2 parents d58439e + 3550a78 commit 053233c
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Improvements

- Support `deleteAfterDestroy` option for the `DeploymentSettings` resource. [#207](https://github.com/pulumi/pulumi-pulumiservice/issues/229)

### Bug Fixes

### Miscellaneous
4 changes: 4 additions & 0 deletions provider/cmd/pulumi-resource-pulumiservice/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@
"shell": {
"type": "string",
"description": "The shell to use to run commands during the deployment. Defaults to 'bash'."
},
"deleteAfterDestroy": {
"type": "boolean",
"description": "Whether the stack should be deleted after it is destroyed."
}
}
},
Expand Down
1 change: 1 addition & 0 deletions provider/pkg/internal/pulumiapi/deployment_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type OperationContextOptions struct {
SkipInstallDependencies bool `json:"skipInstallDependencies,omitempty"`
SkipIntermediateDeployments bool `json:"skipIntermediateDeployments,omitempty"`
Shell string `json:"shell,omitempty"`
DeleteAfterDestroy bool `json:"deleteAfterDestroy,omitempty"`
}

type GitHubConfiguration struct {
Expand Down
7 changes: 7 additions & 0 deletions provider/pkg/provider/deployment_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ func (ds *PulumiServiceDeploymentSettingsInput) ToPropertyMap() resource.Propert
if ds.OperationContext.Options.SkipIntermediateDeployments {
optionsMap["skipIntermediateDeployments"] = resource.NewPropertyValue(true)
}
if ds.OperationContext.Options.DeleteAfterDestroy {
optionsMap["deleteAfterDestroy"] = resource.NewPropertyValue(true)
}
ocMap["options"] = resource.PropertyValue{V: optionsMap}
}
if ds.OperationContext.OIDC != nil {
Expand Down Expand Up @@ -385,6 +388,10 @@ func toOperationContext(inputMap resource.PropertyMap) *pulumiapi.OperationConte
o.Shell = oInput["Shell"].StringValue()
}

if oInput["deleteAfterDestroy"].HasValue() && oInput["deleteAfterDestroy"].IsBool() {
o.DeleteAfterDestroy = oInput["deleteAfterDestroy"].BoolValue()
}

oc.Options = &o
}

Expand Down
6 changes: 6 additions & 0 deletions sdk/dotnet/Inputs/OperationContextOptionsArgs.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions sdk/go/pulumiservice/pulumiTypes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions sdk/nodejs/types/input.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions sdk/python/pulumi_pulumiservice/_inputs.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 053233c

Please sign in to comment.