Comments (6)
take the original inputs returned by Read and continue with them to create a Pulumi program
This is already what we do. The reason we warn about the check failures is that the first time you run up
with those inputs you'll also get check failures, and those will be a hard error not just a warning.
Warn the user that the program will need manual edits before it can succeed in the next pulumi up.
We could probably make this more clear in the warning message.
attempt to generate a minimum set of inputs
Checking the code I think there is capacity to improve things here. Although I think it'll be on the providers to improve things. We use Read
for both import and refresh but importantly for import we don't pass any old inputs/state so the provider can tell the difference between an "import Read" and "refresh Read". When doing an import Read we only need the minimal set of inputs to generate the program, we don't need the full set of inputs to build correct state.
So the provider can probably do a cleanup pass on the inputs returned from the TF provider to fit what's needed for the program. Stuff like optional fields not set, conflict fields that TF says are null, etc.
from pulumi.
Very interesting idea! We are planning some improvements for import this quarter and this may be worth considering as part of that. cc: @Zaid-Ajaj, @Frassle
from pulumi.
Ah actually you are right, I was moving too fast.
The example reads as this:
aws:ec2:Subnet (import-subnet-edfe0bb0):
warning: One or more imported inputs failed to validate. This is almost certainly a bug in the `aws` provider. The import will still proceed, but you will need to edit the generated code after copying it into your program.
warning: aws:ec2/subnet:Subnet resource 'import-subnet-edfe0bb0' has a problem: Conflicting configuration arguments: "availability_zone": conflicts with availability_zone_id. Examine values at 'Subnet.AvailabilityZone'.
warning: aws:ec2/subnet:Subnet resource 'import-subnet-edfe0bb0' has a problem: Conflicting configuration arguments: "availability_zone_id": conflicts with availability_zone. Examine values at 'Subnet.AvailabilityZoneId'.
So it does no block the user but it does commit us to fix this in the provider, which we will not be able to do for all cases as TF does not consider this behavior a bug, so projecting TF to bridged providers, especially build-less providers, will always emit this, I think we need to soften the language here in the warning.
We will fix it for subnet but not sure yet if we can comprehensively fix it for all.
from pulumi.
We already use a heuristic to decide if a Read is a refresh Read or Import Read indeed:
https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/tfbridge/provider.go#L1188
from pulumi.
Cannot close issue:
- does not have required labels:
resolution/
Please fix these problems and try again.
from pulumi.
Will continue in pulumi/pulumi-terraform-bridge#1225
from pulumi.
Related Issues (20)
- Snapshot writes not being elided HOT 1
- `pulumi:template` tag in Pulumi.yaml is blank for new projects created from template
- Officially support pulumi.Output in dynamic providers HOT 1
- Expose API like `pulumi.runtime.setMocks` to mock `Config` and `StackReferences`
- In CLI different types of events are logged with --diff depending on whether it's a pty or not
- TestGenerateProgram/csharp-plain-lists is broken on master
- `pulumi refresh` resulting in state integrity errors HOT 1
- when use vault kubernetes, inputs.tokenReviewerJwt field in stack checkpoint json is not encrypted HOT 2
- Python memory pressure from tracking all outputs till the end of the program
- Structured configuration errors in Pulumi.yaml (which work in Pulumi.stack.yaml) HOT 2
- Add the ability to override `PluginDownloadURL` if it is explicitly set on a plugin
- Add an `ArtifactorySource` as a `PluginSource` to plugins.go
- Do not warn on changing outputs during refresh HOT 1
- Cannot convert undefined or null to object at `@pulumi/runtime/closure/codePaths.ts:250:34` HOT 2
- Allow conformance test sdk generation to run in parallel
- Workflow failure: On Push HOT 4
- Invalid lists of enums in .NET
- CLI concurrent map read and map write panic
- `TestLanguageNewSmoke/java` broken on the main branch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulumi.