cool-dress-96114
07/25/2023, 9:21 PM--target-dependents
flag for pulumi up
.
I’ve got a very minimal stack to outline what I’m describing (see thread). I have a resource a
which depends on b
which depends on c
. I’ve made changes to b
and want to roll out the update to b
and to c
. We explicitly do NOT want to roll out changes to a
on the fly, in favor of a maintenance window due to the sensitivity of the resource.
Is there a way from the command to roll out only those specific resources?
We’ve tried the following:
pulumi up -t 'urn:pulumi:scratch::pragma::random:index/randomInteger:RandomInteger::b' # makes changes to b
pulumi up -t 'urn:pulumi:scratch::pragma::random:index/randomInteger:RandomInteger::b' -t 'urn:pulumi:scratch::pragma::random:index/randomInteger:RandomInteger::c' # makes changes to b and c, as expected
pulumi up -t 'urn:pulumi:scratch::pragma::random:index/randomInteger:RandomInteger::b' --target-dependents # makes changes to a, b, c
Due to the size of our stack, it’s unwieldily and not practical to call -t
for all the resources, as there’s a bunch of nested and resources that are dynamically created resources.
I’m confused why --target-dependents
does not only target the dependents of the b
resource (c
); Ideally there’s a corresponding --target-dependencies
that would also target the dependency resource (in this case a
in addition to b
), but that’s for another thread.provider, err := random.NewProvider(ctx, "rand", &random.ProviderArgs{})
if err != nil {
return err
}
a, err := random.NewRandomInteger(ctx, "a", &random.RandomIntegerArgs{
Max: <http://pulumi.Int|pulumi.Int>(10000),
Min: <http://pulumi.Int|pulumi.Int>(1),
Seed: pulumi.Sprintf("%s", time.Now().String()),
}, pulumi.Provider(provider))
if err != nil {
return err
}
b, err := random.NewRandomInteger(ctx, "b", &random.RandomIntegerArgs{
Max: <http://pulumi.Int|pulumi.Int>(10000),
Min: <http://pulumi.Int|pulumi.Int>(1),
Seed: pulumi.Sprintf("%s", time.Now().String(), a.Result),
}, pulumi.Provider(provider))
if err != nil {
return err
}
_, err = random.NewRandomInteger(ctx, "c", &random.RandomIntegerArgs{
Max: <http://pulumi.Int|pulumi.Int>(10000),
Min: <http://pulumi.Int|pulumi.Int>(1),
Seed: pulumi.Sprintf("%s%d", time.Now().String(), b.Result),
}, pulumi.Provider(provider))
if err != nil {
return err
}
_, err = random.NewRandomInteger(ctx, "d", &random.RandomIntegerArgs{
Max: <http://pulumi.Int|pulumi.Int>(10000),
Min: <http://pulumi.Int|pulumi.Int>(1),
Seed: pulumi.Sprintf("%s", time.Now().String()),
}, pulumi.Provider(provider))
if err != nil {
return err
}
Note that with the Seed
parameter changing for all 3 resources, this is simulating all 3 resources of changes queued up and waiting to be deployed. Trying to figure out how to delay deploying a
Edit: Updated with a provider, same issue still manifests.» pulumi up -t 'urn:pulumi:scratch::pragma::random:index/randomInteger:RandomInteger::b'
Previewing update (scratch):
Type Name Plan Info
pulumi:pulumi:Stack pragma-scratch
+- └─ random:index:RandomInteger b replace [diff: ~seed]
» pulumi up -t 'urn:pulumi:scratch::pragma::random:index/randomInteger:RandomInteger::b' --target-dependents
Previewing update (scratch):
Type Name Plan Info
pulumi:pulumi:Stack pragma-scratch
+- ├─ random:index:RandomInteger a replace [diff: ~seed]
+- ├─ random:index:RandomInteger b replace [diff: ~seed]
+- └─ random:index:RandomInteger c replace [diff: ~seed]
d
) it still shows up as one to change with the --target-dependents
flag
» pulumi up -t 'urn:pulumi:scratch::pragma::random:index/randomInteger:RandomInteger::b' --target-dependents
Previewing update (scratch):
Type Name Plan Info
pulumi:pulumi:Stack pragma-scratch
+- ├─ random:index:RandomInteger a replace [diff: ~seed]
+ ├─ random:index:RandomInteger d create
+- ├─ random:index:RandomInteger b replace [diff: ~seed]
+- └─ random:index:RandomInteger c replace [diff: ~seed]
echoing-dinner-19531
07/26/2023, 12:16 PMcool-dress-96114
07/26/2023, 2:11 PMctx.RegisterComponentResource
call and a provider map, then passing that down as a parent to all subresources
pulumi.ProviderMap(map[string]pulumi.ProviderResource{
"aws": awsProvider,
"buildkite": buildkiteProvider,
"github": githubProvider,
"auth0": auth0Provider,
}
Is this change going to fix what I think is a similar issue for things with non-defaulted providers?echoing-dinner-19531
07/26/2023, 3:40 PMcool-dress-96114
07/26/2023, 4:06 PMechoing-dinner-19531
07/26/2023, 4:07 PMcool-dress-96114
07/26/2023, 5:13 PM