-
Notifications
You must be signed in to change notification settings - Fork 9
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
provider rotation #432
provider rotation #432
Conversation
be5df41
to
4e22ea2
Compare
823ab99
to
9648bb6
Compare
2e67fef
to
a208a03
Compare
3a38658
to
2aefb1c
Compare
2aefb1c
to
53ccc3c
Compare
I don't love the short form intermixing commonInputs:
...
foo:
fn::rotate::provider:
inputs: ${commonInputs}
state: ... I think this is kind of a fundamental issue, FWIW. Even if we store state out-of-band, unless we reference it by path (which kills the ability to refactor via cut-and-paste), we'd need something in the provider inputs that serves as an identifier for the state. |
ast/expr.go
Outdated
if !ok && state != nil { | ||
diags := syntax.Diagnostics{ExprError(stateExpr, "rotation state must be an object literal")} | ||
return RotateSyntax(node, name, args, nil, nil, nil), diags | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to check, we are ok if there is no initial state set on the rotator? (This makes sense but I vaguely recall us mentioning that users would set at least current on this when adding a new rotator)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it depends on the Rotator- the schema can be used to enforce it being present or optional. But I think it's also fine to make the key required 🤷♀️
inputs.export("").Value.(map[string]esc.Value), | ||
state.export("").Value.(map[string]esc.Value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own knowledge, what does export("")
do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is supposed to be the environment name which I think is just used for annotating source ranges?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep that's right
Yeah, hoisting the state out of inputs for the short form is a bit cheeky. I've removed it: 53dc66c |
Co-authored-by: Derek <[email protected]>
7333173
to
58732fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit on naming, but LGTM otherwise
inputs.export("").Value.(map[string]esc.Value), | ||
state.export("").Value.(map[string]esc.Value), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep that's right
Co-authored-by: Pat Gavlin <[email protected]>
This reverts commit 53ccc3c.
aa8712f
to
d5f036c
Compare
Introduces a new provider type and verb to support rotating static credentials.
Rotator providers have an additional
state
input which is used as a write-back target. The result of invoking Rotate is persisted back into the environment to this key. This provides a stable location to write to without accidentally clobbering interpolations that might be used for other inputs.The new
fn::rotate
function type is used to invoke this new type of provider. It behaves similarly to existing providers during Open, but during rotation the evaluator will invoke the Rotate methods and collect their outputs, which are returned to the caller. The caller is expected to persist these updates back into the environment as a new revision.Closes https://github.com/pulumi/pulumi-service/issues/24986