CloudFormation - obtaining template from a repo - amazon-web-services

Can someone list for me the steps needed in order to obtain a template from Azure DevOps repo and have AWS Cloud Formation use it to build a stack.
Interested in best practices and some high-level steps please / requirements E.G. do I need AWS Pipelines? AWS Azure Toolkit?

One of the cleaner ways that I could think of doing this is integrating your DevOps repository with an S3 bucket and then triggering AWS CodePipeline to deploy the stack from the S3 bucket.
The flow would be something like,
Create a bucket in S3 to hold the cf template
Create a service connection request in DevOps repo, this should push the template to S3 every time changes are deployed
Create an AWS CodePipeline workflow that takes the template as input from S3 and deploys it to CloudFormation

Related

Migrate SQS and SNS configuration

We have a few different AWS accounts and I am looking to migrate the SNS configuration from one AWS account to another. Is that possible to migrate?
Many thanks for considering my request.
AWS does not have a 'migrate' capability.
A best-practice is to deploy "infrastructure as code" using CloudFormation or Terraform. Then, when you wish to deploy the same infrastructure to a different AWS Account, simply use the same template to deploy it.
If you did not deploy your initial infrastructure via a template, you might want to use https://former2.com/ to create a template based on existing infrastructure. You can then use that template to deploy the same resources in a different AWS Account.

AWS Cloudformation tying Amplify to bitbucket Repo

I am using CloudFormation to deploy a multilayer application that includes APIGateways, Lambdas, and all the resources created in Amplify and EB. We built each part of the stack manual. Now we are trying to tie them together in one CloudFormation Template. Where we are tripped up is tying the AWS::Amplify::App to our repository in Bitbucket. The account token setting seems not to be available in our bitbucket instance. Is there another way to tie the amplifying part of the CFN template to that repo? or S3?

AWS CloudFormation : Providing CF stack to other AWS accounts

I have an application developed using AWS Serverless components ( Lambda, API Gateway, DynamoDB, Cognito, etc.)
I want to deploy this application to customer's AWS Accounts.
I am thinking to create a CloudFormation stack and give the CF file to the customers. They should be able deploy the application in their AWS account by using this CF stack.
Are there any examples, pointers, best practices for this approach?
How the binaries of the lambda functions are delivered? ( S3 bucket ?)
can the ClodFormation stackSets be used for this?

Getting template for a s3 bucket

It is possible to get a template (yml) for a s3 bucket created using the web console?.
I just want to see how was configured a particular s3, but see it in a template form.
Yes, this should be possible with the new AWS tool called CloudFormer. The tool is still in beta though.
CloudFormer is a template creation beta tool that creates an AWS CloudFormation template from existing AWS resources in your account. You select any supported AWS resources that are running in your account, and CloudFormer creates a template in an Amazon S3 bucket.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-using-cloudformer.html

How to replicate all resources/stack to another aws account?

I am trying to clone my aws account(prod) to another account(test) with all resources and configuration I have set up on prod. Is there any best practice to replicate the aws account to another?
This is not possible.
Nor is there an easy way to list all resources in an AWS account.
Each AWS Service (eg EC2, S3, Lambda) have their own API calls to list resources and describe configurations. There is no universal way to request this information.
Best Practice is to only create resources using AWS CloudFormation templates, thereby having full documentation of resources created and the ability to deploy similar infrastructure in other AWS accounts or regions.
Some third-party services (eg https://www.hava.io/) can extract configuration information and automatically create AWS CloudFormation templates. However, these templates only record the configuration of AWS resources -- they do not replicate the content of storage on disks, Amazon S3 or databases.