Creating AWS Lake Formation Blueprint resource using terraform - amazon-web-services

I have requirement to create a "Blueprint” under aws lakeformation using terraform. I can't seem to find anything on the official terraform docs to support this.
Ideally I would need a separate resource to create the entire blueprint. Something along the lines of "aws_lakeformation_blueprint" in my code. Has anyone worked with creating a lake formation blueprint via terraform or can shine some light on how to deal with this requirement.
The only what I can think of approaching this is by creating all the lake formation resources manually (Crawler , Glue Jobs, Glue Connection , S3 Bucket , IAM Role) which the blueprint usually does for you.
Looked through terraform docs and could not find much :
Terraform docs : https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lakeformation_data_lake_settings

Related

Share AWS resources between Terraform and CDK

My team has two completely different environments: a Terraform one (which allow us to create and manage some AWS resources as databases) and a CDK one, with contains API resources and its logics as well.
We would like to use databases resources created with Terraform in the CDK app.
I was looking for some simple way to import outputs or tfstate from Terraform into CDK app, but I've found nothing.
I'd like to know how'd you achieve something like that?
So, I finally solved this issue by using the tfstate file on CDK : our Remote Backend is AWS, so the tfstate is stored on S3. When we run the CDK app we fetch this file from S3 and we inject its outputs into an application service.
It allows to always get the updated outputs from resources generated with Terraform.

Update some settings of an existing resource using Cloud Formation

I'm new to Cloud Formation. I want to update the settings of already created a lot of RDS instances using Cloud Formation. I don't have the info about either those resources were created through CF or manually. Is it possible to update such resources with CF?
I can think of another way like I can use AWS SDK (boto3) but doing it with CF is perefrable.
The only way to do this from CloudFormation (CF) is to develop your own CF custom resource. This will be a lambda function which will use AWS SDK to query the state of your RDS databases, and perform any actions you want.
Since its fully custom, you can program any logic which satisfies your requirements.
If the resources were created manually, you can also import them to CF, and then update using CF.

Tag events rule AWS - Cloudformation

Cloudformation doesn't support tags for event rules, and I heard somewhere that there's a workaround using cloud formation stacks but I haven't been able to find how exactly.
I know I could use AWS CLI, or tag the resource manually after it's created but I would like to know if there is a workaround using CloudFormation only.
Thanks.
You can create a custom resource using AWS CloudFormation.
Here’s a blog post describing the process and a GitHub project that you might want to look into for examples.

Cloudformation template from existing resources or other possibilities to replicate environment

I have created an ec2 instance and configured it as a target behind my load balancer. I want to convert this entire environment as something that can be deployed repeatedly in automation. I have looked at cloudformation but don't know if it can help me with converting this environment to a cloudformation template. Is there any other way to achieve this. If there is an approach outside of Cloudformation, that's fine too.
PS: I am new to AWS and it's capabilities
Thanks
Have a look at Former2.
Former2 allows you to generate Infrastructure-as-Code outputs from your existing resources within your AWS account.
You need an IaC (Infrastructure as Code) tool. Cloudformation is one of them, but there are plenty others. Terraform, Pulumi or even the AWS CDK.
Look at Infrastructure as Code try AWS CDK, Terraform, you should also look at methods for replacing existing infrastructure. Spinning a fresh set of infrastructure along side the existing one and swapping out in DNS is the most common of approach.

Terraform: Write a CloudFormation Template to disk

We are using Terraform along with a vendor supplied CloudFormation template.
It is all working except for when there are changes to the template. Terraform does not show you what will change as it's all contained within the template.
I was wondering if Terraform could write out the rendered CloudFormation template to disk where we could (in theory) use AWS native CloudFormation to create a change set to attempt to see the changes.
Any ideas if Terraform can write this out?
Terraform works by abstracting different infrastructure types into providers. In the case of AWS, the AWS Provider interprets your Terraform config into a set of AWS API calls. It does not internally create any CloudFormation templates, and has no understanding of or mapping to CloudFormation.
If you really want to use Terraform to describe changes made via CloudFormation you will likely have to create your own tool to convert CF templates into Terraform Variable files. As each new variable file is generated, you could run terraform plan to see what the outcome would be.