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

Calling pulumiservice.TeamStackPermission() with --refresh always (re)create the resource #202

Closed
aureq opened this issue Nov 21, 2023 · 1 comment · Fixed by #205
Closed
Assignees
Labels
customer/feedback Feedback from customers kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@aureq
Copy link
Member

aureq commented Nov 21, 2023

What happened?

I'm trying to create a TeamStackPermission with the program below. The initial deployment works as expected and the permission is correctly applied against the stack ✅. Running pulumi up works as expected as well ✅.

However, running pulumi up --refresh shows the TeamStackPermission being (re)created every single time. Though the deployment doesn't fail.

🌈✨ ❯ pulumi up --refresh=true --yes 
Previewing update (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/menfin/pulumiservice-ts/dev/previews/55cbb801-ce44-47e0-8e6f-2c1b9b5daba6

     Type                                        Name                              Plan       
     pulumi:pulumi:Stack                         pulumiservice-ts-dev                         
     ├─ pulumiservice:index:TeamAccessToken      [coolspot]-token                             
 +   ├─ pulumiservice:index:TeamStackPermission  [coolspot]-team-stack-permission  create     
     ├─ random:index:RandomString                [coolspot]-pulumi-token-suffix               
 ~   └─ pulumiservice:index:Team                 [coolspot]-team                   update     

Resources:
    + 1 to create
    ~ 1 to update
    2 changes. 3 unchanged

Updating (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/menfin/pulumiservice-ts/dev/updates/10

     Type                                        Name                              Status              
     pulumi:pulumi:Stack                         pulumiservice-ts-dev                                  
 ~   ├─ pulumiservice:index:Team                 [coolspot]-team                   updated (0.52s)     
 +   ├─ pulumiservice:index:TeamStackPermission  [coolspot]-team-stack-permission  created (0.63s)     
     ├─ random:index:RandomString                [coolspot]-pulumi-token-suffix                        
     └─ pulumiservice:index:TeamAccessToken      [coolspot]-token                                      

Resources:
    + 1 created
    ~ 1 updated
    2 changes. 3 unchanged

Duration: 5s

I'm assuming this is because the read() function hasn't been implemented yet for this resource, similar to #159.

Example

import * as pulumi from "@pulumi/pulumi";
import * as pulumiservice from "@pulumi/pulumiservice";

export = async () => {

    const orgName = pulumi.getOrganization();
    const teamName = "team-1";
    const pipelineName = "coolspot";

    const pulumiTeamStackPermission = new pulumiservice.TeamStackPermission(`[${pipelineName}]-team-stack-permission`, {
        organization: orgName,
        team: teamName,
        project: pulumi.getProject(),
        stack: pulumi.getStack(),
        permission: pulumiservice.TeamStackPermissionScope.Admin,
    });
}

Output of pulumi about

CLI          
Version      3.93.0
Go Version   go1.21.3
Go Compiler  gc

Plugins
NAME           VERSION
nodejs         unknown
pulumiservice  0.16.0
random         4.13.2

Host     
OS       debian
Version  12.2
Arch     x86_64

This project is written in nodejs: executable='/usr/local/bin/node' version='v20.9.0'

Current Stack: menfin/pulumiservice-ts/dev

Found no resources associated with dev

Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/aureq
User           aureq
Organizations  aureq, team-ce, menfin, menfin-team, demo, pulumi
Token type     personal

Dependencies:
NAME                   VERSION
@pulumi/pulumi         3.78.0
@pulumi/pulumiservice  0.16.0
@pulumi/random         4.13.2
@types/node            16.18.40

Pulumi locates its logs in /tmp by default

Additional context

This issue happens on the latest version 0.16.0.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@aureq aureq added kind/bug Some behavior is incorrect or out of spec customer/feedback Feedback from customers needs-triage Needs attention from the triage team labels Nov 21, 2023
@cleverguy25 cleverguy25 removed the needs-triage Needs attention from the triage team label Nov 22, 2023
@cleverguy25 cleverguy25 added this to the 0.98 milestone Nov 22, 2023
@MitchellGerdisch
Copy link

FWIW, a variation of this issue is that just running pulumi refresh will remove the team stack permission from state.

@cleverguy25 cleverguy25 removed this from the 0.98 milestone Dec 14, 2023
@komalali komalali added this to the 0.98 milestone Dec 14, 2023
@komalali komalali self-assigned this Dec 14, 2023
komalali added a commit that referenced this issue Dec 18, 2023
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer/feedback Feedback from customers kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants