Reputation: 314
I'm new to Terraform CDK and I need to use it to create some Okta applications. However, I want to store its state files in the AWS S3 bucket. So, my question is to achieve this, should I create an AWS S3 bucket through terraform cdk separately in another stack and pass it to the okta cdk stack?
Upvotes: 0
Views: 48
Reputation: 1891
Not exactly. When running Terraform for the first time it would check if there is a state file, failing.
I would suggest creating the bucket by other means: with a script that uses the AWS CLI, having a separate Terraform project only for this, any other programmatic way or even manually (documenting it somewhere).
The only simple option that comes to my mind to do it in the way you ask is to run Terraform once without the backend to create the bucket, then move the state to the bucket and configure the backend.
Upvotes: 1