pulumi/pkg/resource
bors[bot] 523b3f3290
Merge #12082
12082: Track resource created and updated times r=dixler a=blampe

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

This PR adds the `Created` and `Modified` timestamps that are optional.

`Created`: Created tracks when the resource was first added to state by pulumi. Checkpoints prior to early 2023 do not include this. (Create, Import)
`Modified`: Modified tracks when the resource state was last altered. Checkpoints prior to early 2023 do not include this. (Create, Import, Read, Refresh, Update)

When serialized they will follow RFC3339 with nanoseconds captured by a test case.
https://pkg.go.dev/time#RFC3339

Note: Older versions of pulumi may strip these fields when modifying the state.

For future expansion, when we inevitably need to track other timestamps, we'll add a new "operationTimestamps" field (or something similarly named that clarified these are timestamps of the actual Pulumi operations).

	operationTimestamps: {
		created: ...,
		updated: ...,
		imported: ...,
	}


Fixes https://github.com/pulumi/pulumi/issues/12022

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Bryce Lampe <bryce@pulumi.com>
2023-03-27 16:37:03 +00:00
..
analyzer all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
deploy Merge #12082 2023-03-27 16:37:03 +00:00
edit all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
graph all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
provider all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
stack This commit adds the `Created` and `Modified` timestamps to pulumi state that are optional. 2023-03-27 09:28:26 -07:00
testdata ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00