Open pylaligand opened 2 months ago
Hey @pylaligand. Thanks for reporting this issue. It looks like this bug is from a combination of two behaviors:
We will take a look at getting this working for you as soon as we have the time.
@pylaligand As a workaround, you should be able to import this resource with a pulumi import
command.
I can reproduce the original issue as stated. Unfortunately that workaround does not work smoothly either, we might need to take further action to fix this.
PULUMI_DEBUG_GRPC=$PWD/import.json pulumi import github:index/actionsRepositoryAccessLevel:ActionsRepositoryAccessLevel test41 t0yv0-nixos
Results in:
Previewing import (dev)
View in Browser (Ctrl+O): https://app.pulumi.com/anton-pulumi-corp/github-642/dev/previews/ef81aeb2-c306-49b8-a364-8cd98072d6db
Type Name Plan Info
pulumi:pulumi:Stack github-642-dev
= └─ github:index:ActionsRepositoryAccessLevel test41 import 2 warnings
Diagnostics:
github:index:ActionsRepositoryAccessLevel (test41):
warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `github` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
warning: github:index/actionsRepositoryAccessLevel:ActionsRepositoryAccessLevel resource 'test41' has a problem: Missing required argument. The argument "repository" is required, but no definition was found.. Examine values at 'test41.repository'.
Resources:
= 1 to import
2 unchanged
The read method is not populating the required field:
{
"method": "/pulumirpc.ResourceProvider/Read",
"request": {
"id": "t0yv0-nixos",
"urn": "urn:pulumi:dev::github-642::github:index/actionsRepositoryAccessLevel:ActionsRepositoryAccessLevel::test41",
"properties": {}
},
"response": {
"id": "t0yv0-nixos",
"properties": {
"accessLevel": "none",
"id": "t0yv0-nixos"
},
"inputs": {
"__defaults": [],
"accessLevel": "none"
}
},
"metadata": {
"kind": "resource",
"mode": "client",
"name": "github"
}
}
You can ignore the warning and proceed, generating:
Please copy the following code into your Pulumi application. Not doing so
will cause Pulumi to report that an update will happen on the next update command.
Please note that the imported resources are marked as protected. To destroy them
you will need to remove the `protect` option and run `pulumi update` *before*
the destroy will take effect.
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const test41 = new github.ActionsRepositoryAccessLevel("test41", {
accessLevel: "none",
repository: "",
}, {
protect: true,
});
But then need to edit repository to the desired repository.
Version 3.117.0
Go Version go1.22.3
Go Compiler gc
Plugins
KIND NAME VERSION
resource github 6.2.1
language nodejs unknown
Host
OS darwin
Version 14.5
Arch arm64
This project is written in nodejs: executable='/Users/anton/bin/node' version='v18.18.2'
Current Stack: anton-pulumi-corp/github-642/dev
TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::github-642::pulumi:pulumi:Stack::github-642-dev
pulumi:providers:github urn:pulumi:dev::github-642::pulumi:providers:github::default_6_2_1
github:index/repository:Repository urn:pulumi:dev::github-642::github:index/repository:Repository::r
github:index/actionsRepositoryAccessLevel:ActionsRepositoryAccessLevel urn:pulumi:dev::github-642::github:index/actionsRepositoryAccessLevel:ActionsRepositoryAccessLevel::test41
Found no pending operations associated with dev
Backend
Name pulumi.com
URL https://app.pulumi.com/anton-pulumi-corp
User anton-pulumi-corp
Organizations anton-pulumi-corp, moolumi, pulumi
Token type personal
Dependencies:
NAME VERSION
@pulumi/github 6.2.1
@pulumi/pulumi 3.120.0
@types/node 18.19.34
typescript 5.4.5
Pulumi locates its logs in /var/folders/gd/3ncjb1lj5ljgk8xl5ssn_gvc0000gn/T/com.apple.shortcuts.mac-helper// by default
What happened?
I am trying to import
ActionsRepositoryAccessLevel
resources for some already existing repositories. Even if the access level matches what's currently in GitHub, imports will fail because of arepository
attribute that's allegedly missing from the "remote" state.Example
View in Browser (Ctrl+O): https://app.pulumi.com////previews/
= ├─ github:index:ActionsRepositoryAccessLevel actions-access- import [diff: +repository]; 1 warning
Diagnostics: github:index:ActionsRepositoryAccessLevel (actions-access-):
warning: inputs to import do not match the existing resource; importing this resource will fail
Output of
pulumi about
Additional context
No response
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).