The <#C019959SHNJ|> group is not active so posting...
# getting-started
a
The #C019959SHNJ group is not active so posting it here. Hoping folks can help me understand how Pulumi works. I want to manage a GitLab group, its sub-groups and repositories with Pulumi. The group and repositories already created. Now I want to update the group properties. Should I expect Pulumi to update the properties when I run
pulumi up
?
m
When you edit your existing Pulumi program that you used to create the group and repos, any change will be applied when you run
pulumi up
. (You’ll also get a preview before the changes are applied.)
a
Thank you for your response. The groups and repositories already exist. I imported the groups for starters, just to see how it works.
pulumi preview
indicates that it wants to delete the groups.
Copy code
vscode ➜ /workspaces/gitlab-gitops (aws-gitops) $ pulumi preview
Previewing update (prod):
     Type                   Name                                         Plan       Info
     pulumi:pulumi:Stack    gitlab-gitops-prod                                      1 error; 6 messages
 -   ├─ gitlab:index:Group  redhat/ai/models-validation                  delete     1 error
 -   ├─ gitlab:index:Group  redhat/ai/models-validation/platform         delete     1 error
 -   └─ gitlab:index:Group  redhat/ai/models-validation/platform/images  delete     1 error

Diagnostics:
  gitlab:index:Group (redhat/ai/models-validation/platform/images):
    error: Preview failed: resource "urn:pulumi:prod::gitlab-gitops::gitlab:index/group:Group::redhat/ai/models-validation/platform/images" cannot be deleted
    because it is protected. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`, or use the command:
    `pulumi state unprotect 'urn:pulumi:prod::gitlab-gitops::gitlab:index/group:Group::redhat/ai/models-validation/platform/images'`

  pulumi:pulumi:Stack (gitlab-gitops-prod):
    Using existing group: redhat/ai/models-validation (ID: 102995824)
    Using existing group: redhat/ai/models-validation/platform (ID: 103764040)
    Using existing group: redhat/ai/models-validation/platform/images (ID: 103854090)
    Project already exists: redhat/ai/models-validation/platform/images/ubi-gh (ID: 67951242)
    Project already exists: redhat/ai/models-validation/platform/gitlab-gitops (ID: 67898753)
    Project already exists: redhat/ai/models-validation/platform/aws-gitops (ID: 67976666)
    error: preview failed

  gitlab:index:Group (redhat/ai/models-validation):
    error: Preview failed: resource "urn:pulumi:prod::gitlab-gitops::gitlab:index/group:Group::redhat/ai/models-validation" cannot be deleted
    because it is protected. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`, or use the command:
    `pulumi state unprotect 'urn:pulumi:prod::gitlab-gitops::gitlab:index/group:Group::redhat/ai/models-validation'`

  gitlab:index:Group (redhat/ai/models-validation/platform):
    error: Preview failed: resource "urn:pulumi:prod::gitlab-gitops::gitlab:index/group:Group::redhat/ai/models-validation/platform" cannot be deleted
    because it is protected. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`, or use the command:
    `pulumi state unprotect 'urn:pulumi:prod::gitlab-gitops::gitlab:index/group:Group::redhat/ai/models-validation/platform'`

Resources:
    1 unchanged
OK. Identified a bug in my program. Now it does want to update but the update doesn't take place.
Copy code
vscode ➜ /workspaces/gitlab-gitops (aws-gitops) $ pulumi up
Previewing update (prod):
     Type                   Name                                         Plan       Info
     pulumi:pulumi:Stack    gitlab-gitops-prod                                      3 messages
 ~   ├─ gitlab:index:Group  redhat/ai/models-validation                  update     [diff: ~projectCreationLevel,subgroupCreationLevel]
 ~   ├─ gitlab:index:Group  redhat/ai/models-validation/platform         update     [diff: ~projectCreationLevel,subgroupCreationLevel]
 ~   └─ gitlab:index:Group  redhat/ai/models-validation/platform/images  update     [diff: ~projectCreationLevel,subgroupCreationLevel]

Diagnostics:
  pulumi:pulumi:Stack (gitlab-gitops-prod):
    Project already exists: redhat/ai/models-validation/platform/images/ubi-gh (ID: 67951242)
    Project already exists: redhat/ai/models-validation/platform/gitlab-gitops (ID: 67898753)
    Project already exists: redhat/ai/models-validation/platform/aws-gitops (ID: 67976666)

Resources:
    ~ 3 to update
    1 unchanged

Do you want to perform this update? yes
Updating (prod):
     Type                   Name                                         Status           Info
     pulumi:pulumi:Stack    gitlab-gitops-prod                                            3 messages
 ~   ├─ gitlab:index:Group  redhat/ai/models-validation                  updated (2s)     [diff: ~projectCreationLevel,subgroupCreationLevel]
 ~   ├─ gitlab:index:Group  redhat/ai/models-validation/platform         updated (2s)     [diff: ~projectCreationLevel,subgroupCreationLevel]
 ~   └─ gitlab:index:Group  redhat/ai/models-validation/platform/images  updated (2s)     [diff: ~projectCreationLevel,subgroupCreationLevel]

Diagnostics:
  pulumi:pulumi:Stack (gitlab-gitops-prod):
    Project already exists: redhat/ai/models-validation/platform/images/ubi-gh (ID: 67951242)
    Project already exists: redhat/ai/models-validation/platform/gitlab-gitops (ID: 67898753)
    Project already exists: redhat/ai/models-validation/platform/aws-gitops (ID: 67976666)

Resources:
    ~ 3 updated
    1 unchanged
NM. Found the problem and it works now. Thank you so much.