Provider generation doesn't work with v0.0.5
See original GitHub issueCommunity Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
cdktf & Language Versions
- cdktf v0.0.5
- cdktf-cli v0.0.5
Affected Resource(s)
TerraformProvider
?
cdktf.json
{
"language": "typescript",
"app": "node main.js",
"terraformProviders": ["aws@~> 2.0"]
}
main.ts
import { Construct } from 'constructs';
import { App, TerraformStack } from 'cdktf';
import { Instance } from './.gen/providers/aws';
class MyStack extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
new Instance(this, 'Hello', {
ami: "ami-2757f631",
instanceType: "t2.micro"
});
}
}
const app = new App();
new MyStack(app, 'terraform-cdk-example');
app.synth();
Expected Behavior
After running yarn compile
and cdktf synth
, we should see the following in the
terraformcdkexample.tf.json
file in cdktf.out
folder.
{
"terraform": {
"required_providers": {
"aws": "~> 2.0"
}
},
"resource": {
"aws_instance": {
"terraformcdkexampleHello8B822F74": {
"ami": "ami-2757f631",
"instance_type": "t2.micro"
}
}
}
}
Actual Behavior
terraformcdkexample.tf.json
{
"resource": {
"aws_instance": {
"terraformcdkexampleHello8B822F74": {
"ami": "ami-2757f631",
"instance_type": "t2.micro"
}
}
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
v0.4.0 - Error: Provider produced inconsistent result after apply ...
We are facing this issue with Standard cluster where we get either 404 error or terraform root resource missing error. We started with...
Read more >Configuration - Rocket Programming Guide
Rocket's configuration system is based on Figment's Provider s, types which provide ... environment variable starting at the current working directory.
Read more >Draft Report - v0.0.5rm - 3GPP
Draft Report - v0.0.5rm. Source: Secretary TSG SA (Maurice Pope, MCC). Title: Draft Report of TSG SA meeting #24 - Draft version 0.0.5....
Read more >Modeling Assumptions of the MVS - Multi-vector simulator
It stands for system planning and licensing costs. If you have optimized your energy system and see that an asset might not be...
Read more >Dali Developer Documentation v0.5 - Eclipsepedia
1 Dali JPA Tools 0.5 – Internal/External Developer Documentation ... Validation in the form of “Problems” are reported based on the state of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is a consequence of stabilizing provider generation. We moved this to the
TerraformProvider
implementation rather than withinget
. If we try to synthesize provider versioning on the stack level, I think we’re back to the problems we had before.If our expected behavior is to generate a
terraform
block oncdktf get
, then we will need to do a refactor to generate that at the top-level. I’m more inclined to make it a requirement to declareAwsProvider
, etc. and document that it is required in the guides in order to render the top-levelterraform
block withrequired_provider
.I’m going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you’ve found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.