Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hcl2cdk): snapshot generated code instead of snapshotting that th…
…e function returns a promise
- Loading branch information
1 parent
78f2eef
commit 27ca9fa
Showing
2 changed files
with
96 additions
and
9 deletions.
There are no files selected for viewing
93 changes: 89 additions & 4 deletions
93
packages/@cdktf/hcl2cdk/test/__snapshots__/hcl2cdk.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,94 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`convert Cross-Language Support supports csharp 1`] = `Promise {}`; | ||
exports[`convert Cross-Language Support supports csharp 1`] = ` | ||
"/*Provider bindings are generated by running cdktf get. | ||
See https://cdk.tf/provider-generation for more details.*/ | ||
using Gen.Providers.Aws; | ||
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: aws. | ||
For a more precise conversion please use the --provider flag in convert.*/ | ||
var awsKmsKeyExamplekms = new KmsKey.KmsKey(this, \\"examplekms\\", new Struct { | ||
Deletion_window_in_days = 7, | ||
Description = \\"KMS key 1\\" | ||
}); | ||
var awsS3BucketExamplebucket = new S3Bucket.S3Bucket(this, \\"examplebucket\\", new Struct { | ||
Acl = \\"private\\", | ||
Bucket = \\"examplebuckettftest\\" | ||
}); | ||
new S3BucketObject.S3BucketObject(this, \\"examplebucket_object\\", new Struct { | ||
Bucket = $\\"\\\\\\\\\${element({awsS3BucketExamplebucket.fqn}, 0).id}\\", | ||
Key = \\"someobject\\", | ||
Kms_key_id = awsKmsKeyExamplekms.Arn, | ||
Source = \\"index.html\\" | ||
});" | ||
`; | ||
|
||
exports[`convert Cross-Language Support supports java 1`] = `Promise {}`; | ||
exports[`convert Cross-Language Support supports java 1`] = ` | ||
"/*Provider bindings are generated by running cdktf get. | ||
See https://cdk.tf/provider-generation for more details.*/ | ||
import gen.providers.aws.*; | ||
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: aws. | ||
For a more precise conversion please use the --provider flag in convert.*/ | ||
Object awsKmsKeyExamplekms = KmsKey.Builder.create(this, \\"examplekms\\") | ||
.deletion_window_in_days(7) | ||
.description(\\"KMS key 1\\") | ||
.build(); | ||
Object awsS3BucketExamplebucket = S3Bucket.Builder.create(this, \\"examplebucket\\") | ||
.acl(\\"private\\") | ||
.bucket(\\"examplebuckettftest\\") | ||
.build(); | ||
S3BucketObject.Builder.create(this, \\"examplebucket_object\\") | ||
.bucket(String.format(\\"\\\\\\\\\${element(%s, 0).id}\\", awsS3BucketExamplebucket.getFqn())) | ||
.key(\\"someobject\\") | ||
.kms_key_id(awsKmsKeyExamplekms.getArn()) | ||
.source(\\"index.html\\") | ||
.build();" | ||
`; | ||
|
||
exports[`convert Cross-Language Support supports python 1`] = `Promise {}`; | ||
exports[`convert Cross-Language Support supports python 1`] = ` | ||
"# Provider bindings are generated by running cdktf get. | ||
# See https://cdk.tf/provider-generation for more details. | ||
import ...gen.providers.aws as aws | ||
# The following providers are missing schema information and might need manual adjustments to synthesize correctly: aws. | ||
# For a more precise conversion please use the --provider flag in convert. | ||
aws_kms_key_examplekms = aws.kms_key.KmsKey(self, \\"examplekms\\", | ||
deletion_window_in_days=7, | ||
description=\\"KMS key 1\\" | ||
) | ||
aws_s3_bucket_examplebucket = aws.s3_bucket.S3Bucket(self, \\"examplebucket\\", | ||
acl=\\"private\\", | ||
bucket=\\"examplebuckettftest\\" | ||
) | ||
aws.s3_bucket_object.S3BucketObject(self, \\"examplebucket_object\\", | ||
bucket=f\\"\\\\\\\\\${element({awsS3BucketExamplebucket.fqn}, 0).id}\\", | ||
key=\\"someobject\\", | ||
kms_key_id=aws_kms_key_examplekms.arn, | ||
source=\\"index.html\\" | ||
)" | ||
`; | ||
|
||
exports[`convert Cross-Language Support supports typescript 1`] = `Promise {}`; | ||
exports[`convert Cross-Language Support supports typescript 1`] = ` | ||
"/*Provider bindings are generated by running cdktf get. | ||
See https://cdk.tf/provider-generation for more details.*/ | ||
import * as aws from \\"./.gen/providers/aws\\"; | ||
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: aws. | ||
For a more precise conversion please use the --provider flag in convert.*/ | ||
const awsKmsKeyExamplekms = new aws.kmsKey.KmsKey(this, \\"examplekms\\", { | ||
deletion_window_in_days: 7, | ||
description: \\"KMS key 1\\", | ||
}); | ||
const awsS3BucketExamplebucket = new aws.s3Bucket.S3Bucket( | ||
this, | ||
\\"examplebucket\\", | ||
{ | ||
acl: \\"private\\", | ||
bucket: \\"examplebuckettftest\\", | ||
} | ||
); | ||
new aws.s3BucketObject.S3BucketObject(this, \\"examplebucket_object\\", { | ||
bucket: \`\\\\\${element(\${awsS3BucketExamplebucket.fqn}, 0).id}\`, | ||
key: \\"someobject\\", | ||
kms_key_id: awsKmsKeyExamplekms.arn, | ||
source: \\"index.html\\", | ||
}); | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters