Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding provider support for Drift Schedules and Ttl Schedules #249

Merged
merged 4 commits into from
Apr 23, 2024

Conversation

IaroslavTitov
Copy link
Contributor

Summary

  • Adding schema for drift and ttl schedules
  • Adding pulumi service resources for both
  • Extended schedule client to be able to call C and U operations for drift and schedules
  • Moved some functionality into shared functions to reuse between raw, drift and ttl schedules

Testing

  • Tested locally using DotNet SDK
  • Creating, Updating, Destroying works as expected
  • Verified in console schedules are created and showing up
    var drift = new DriftSchedule(
        "Drift Schedule 1",
        new DriftScheduleArgs{
            Organization = "IaroslavTitov",
            Project = "PulumiDotnet",
            Stack = "SdkTest3",
            ScheduleCron = "0 8 * * 0",
            AutoRemediate = false
        }
    );

    var ttl = new TtlSchedule(
        "Ttl Schedule 1",
        new TtlScheduleArgs{
            Organization = "IaroslavTitov",
            Project = "PulumiDotnet",
            Stack = "SdkTest3",
            Timestamp = "2026-01-01T00:00:00Z",
            DeleteAfterDestroy = true
        }
    );
    ```

provider/cmd/pulumi-resource-pulumiservice/schema.json Outdated Show resolved Hide resolved
provider/cmd/pulumi-resource-pulumiservice/schema.json Outdated Show resolved Hide resolved
provider/cmd/pulumi-resource-pulumiservice/schema.json Outdated Show resolved Hide resolved
"description": "Schedule ID of the created schedule, assigned by Pulumi Cloud.",
"type": "string"
}
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleteAfterDestroy is missing from the outputs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, adding

provider/pkg/internal/pulumiapi/schedules.go Outdated Show resolved Hide resolved
provider/pkg/internal/pulumiapi/schedules.go Outdated Show resolved Hide resolved
provider/cmd/pulumi-resource-pulumiservice/schema.json Outdated Show resolved Hide resolved
komalali and others added 3 commits April 23, 2024 16:10
In my previous
[PR](#241) we only
fixed this in the release.yml workflow. This PR updates the token
everywhere.
Removing the second file that no longer exists, as @iwahbe suggested. 

@komalali , is there any way to run this before merging in?
@IaroslavTitov IaroslavTitov merged commit 73cf3a2 into main Apr 23, 2024
13 checks passed
@IaroslavTitov IaroslavTitov deleted the iaro/schedules branch April 23, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants