-
Notifications
You must be signed in to change notification settings - Fork 156
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
Issue with AWS CodeBuild with projectVisibility is empty #3158
Comments
Potentially related issue from the upstream TF provider: hashicorp/terraform-provider-aws#22473 |
Additional info, might be useful:
|
Thank you for reporting this! My team will pick this up as time permits. Additional context. In SDKv2 upstream this is defined as:
But the default value is not propagated into the Pulumi schema for some reason.
Theoretically not specifying projectVisibility should assume PRIVATE here, so |
Thanks @t0yv0 . Might I ask, what is that |
Ah sorry that's just some personal tool I've been working on (https://github.com/t0yv0/pus) to assist this kind of lookup; it's not yet really ready for public use. You can get roughly the same result out with |
There are a couple of issues going on here, but the issues will only occur if you are working in a region that does not yet support the When you create a project, the default Where this issue diverges from upstream is that if you try this in Terraform, Terraform will let you import the Project, but will then fail on subsequent actions. Pulumi will not let you proceed with the import because it shows a diff warning: inputs to import do not match the existing resource; importing this resource will fail
= aws:codebuild/project:Project: (import)
[id=chall-project-e287179]
[urn=urn:pulumi:dev::pulumi-typescript-app::aws:codebuild/project:Project::chall-project]
[provider=urn:pulumi:dev::pulumi-typescript-app::pulumi:providers:aws::default_6_41_0::f13b0394-998a-465b-ba4a-867fe8f91cfa]
+ projectVisibility: "PRIVATE"
Resources:
= 1 to import
3 unchanged
...
error: inputs to import do not match the existing resource
error: update failed I don't think this is something we should fix on the Pulumi side. Ideally this is something that should be fixed upstream, maybe as a "project_visibility": {
Type: schema.TypeString,
Optional: true,
Default: types.ProjectVisibilityTypePrivate,
DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool {
return oldValue == "" && newValue == "PRIVATE"
},
ValidateDiagFunc: enum.Validate[types.ProjectVisibilityType](),
}, |
What happened?
I import a AWS CodeBuild project using
pulumi import
, it shows a warning:and then I run
pulumi up
but I get an error:Since I set
ignore_changes=["projectVisibility"]
as my resource options (see code below), I expect that Pulumi will ignore theprojectVisibility
attribute but it doesn't.Currently I work around it by running
pulumi stack export
after importing the CodeBuild project and then manually editing the export result json file, and then I runpulumi stack import
with the edited file. It works fine but if I runpulumi refresh
I am back to square one.Example
My code:
Output of
pulumi about
CLI
Version 3.97.0
Go Version go1.21.5
Go Compiler gc
Plugins
NAME VERSION
aws 6.14.0
python unknown
Host
OS darwin
Version 14.2
Arch arm64
This project is written in python: executable='/opt/homebrew/bin/python3' version='3.11.6'
Current Stack: organization/infra/staging
TYPE URN
pulumi:pulumi:Stack urn:pulumi:staging::infra::pulumi:pulumi:Stack::infra-staging
pulumi:providers:aws urn:pulumi:staging::infra::pulumi:providers:aws::default_6_14_0
aws:ecr/repository:Repository urn:pulumi:staging::infra::aws:ecr/repository:Repository::ecr_repo_apicron
...
aws:codebuild/project:Project urn:pulumi:staging::infra::aws:codebuild/project:Project::codebuild_bca_trx_ner_v2
aws:codebuild/project:Project urn:pulumi:staging::infra::aws:codebuild/project:Project::codebuild_finscore_v4
Found no pending operations associated with staging
Backend
Name cangkeh-m2-1.local
URL s3://pulumi-state-staging-xxxxxxxxxxx?awssdk=v2&profile=myprofile
User rizaldim
Organizations
Token type personal
Dependencies:
NAME VERSION
pip 23.3.2
pulumi-aws 6.14.0
setuptools 69.0.2
wheel 0.42.0
Pulumi locates its logs in /var/folders/z8/60m0nm0919d33zg8kppj0t600000gs/T/ by default
Additional context
aws codebuild batch-get-projects --names <project_name>
to check the value ofprojectVisibility
of the project but that attribute doesn't show up in the outputaws codebuild update-project-visibility --project-arn <proj_arn> --project-visibility PRIVATE --debug
to update its visibility but I got this error: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).
The text was updated successfully, but these errors were encountered: