AWS Notes
5.6K subscribers
444 photos
42 videos
10 files
2.8K links
AWS Notes — Amazon Web Services Educational and Information Channel

Chat: https://xn--r1a.website/aws_notes_chat

Contacts: @apple_rom, https://www.linkedin.com/in/roman-siewko/
Download Telegram
​​cfn-teleport

A command-line tool which can move CloudFormation resources between stacks.

https://github.com/udondan/cfn-teleport

cfn-teleport --source Stack1 --target Stack2 --resource Bucket21D68F7E8 --resource Bucket182C536A1 --yes

#CloudFormation
👍8
​​Вдруг вы не заметили в AWS IAM Actions есть Generator:

https://www.awsiamactions.io/generator

В нём можно не только собрать нужную конструкцию политик в JSON, но и сразу же конвертировать это в Terraform и CloudFormation.

#IAM #Terraform #CloudFormation
🔥37👍1
​​CloudFormation team is running a survey to learn more about your perception of CloudFormation performance, with the goal of helping to improve the customer experience.

📢 Take the survey at:

https://amazonmr.au1.qualtrics.com/jfe/form/SV_2lwFTzuDD4aZL0i

#CloudFormation
👍2👌2
​​Loops in CloudFormation: !ForEach 💪

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-foreach.html

AWSTemplateFormatVersion: 2010-09-09
Transform: 'AWS::LanguageExtensions'
Resources:
'Fn::ForEach::Tables':
- TableName
- [Points, Score, Name, Leaderboard]
- 'DynamoDB${TableName}':
Type: 'AWS::DynamoDB::Table'
Properties:
TableName: !Ref TableName
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: '5'
WriteCapacityUnits: '5'

Fn::ForEach can be used in the sections:

▫️ Resource
▪️ Resource properties
▫️ Conditions
▫️ Outputs

Fn::ForEach parameters

Identifier (String) → Identifier is used to refer to the current element we’re iterating over within the Collection (Array of Strings).

Collection (Array of Strings) → Array of values that the Identifier can take.

OutputKey (String) → The key of the resulting key-value pair for the given element in the collection that will be merged to the parent object.

OutputValue (Any) → The value of the resulting key-value pair for the given element in the collection that will be merged to the parent object.

Note: the syntax of Fn::ForEach declaration has a suffix where the UniqueLoopName is used to identify the loop. This allows multiple Fn::ForEach function references to be declared on a given level.

#CloudFormation
🔥104😱4😁3👍1
🆕 CloudFormation + GitOps

https://aws.amazon.com/blogs/devops/automate-safe-aws-cloudformation-deployments-from-github/

With CloudFormation Git sync, you can manage your stacks with Git repository. The repository is monitored for changes to two files:

▫️ A CloudFormation template file that defines a stack
▫️ A stack deployment file that contains parameters that configure the stack

When you commit changes to the template or the deployment file, CloudFormation automatically updates the stack.

Supported:

GitHub
GitHub Enterprise
GitLab
Bitbucket

#CloudFormation
👍1
​​AWS infrastructure as code: A year in review

Исключительно полезное видео, рекомендуется всем, даже если вы всегда используете лишь Terraform.

https://www.youtube.com/watch?v=fROlLTMRi0Y

Здесь очень важно будет узнать про CloudFormation resource registry, который теперь является фундаментом работы всего AWS по части IaC, в том числе который уже совсем скоро станет основным и для Terraform.

Особенно полезным видео может быть Карену — отличный набор инсайтов для третьего издания Mastering AWS CloudFormation. 😀

#CloudFormation #reInvent
🔥6
Вдруг вы не заметили, что CloudFormation стэки стали деплоиться на глаз заметно быстрей:

https://aws.amazon.com/blogs/devops/how-we-sped-up-aws-cloudformation-deployments-with-optimistic-stabilization/

Конечно не заметили — у нас ведь Terraform, ха-ха-ха. Это важный момент, т.к. много процессов под капотом запускает CloudFormation (например, AWS CDK, Control Tower и др.), так что это приведёт к общему ускорению работы AWS.

#CloudFormation
🔥106👍2
CloudFormation + FORCE_DELETE_STACK

Зависшие при удалении стэки можно принудительно убить:

aws cloudformation delete-stack --stack-name some-stack --deletion-mode FORCE_DELETE_STACK

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-cli-deleting-stack.html

Это сильно упрощает удаление стэков с бакетами, содержащими объекты.

#CloudFormation
🔥7👍4
CloudFormation + разбиение стэков и переименование ресурсов 🎉

https://aws.amazon.com/blogs/devops/introducing-aws-cloudformation-stack-refactoring/

Теперь можно разбить толстый существующий CloudFormation Stack на маленькие, то есть перекинуть ресурсы из одного в другой!

А ещё к тому можно переименовать любой ресурс в человеческое название! То есть наконец-то могу закрыть гештальт и переименовать ресурс продовской базы TestDbToDelete, дабы не смущать каждое поколение новых девопсов на проекте, объясняя, кто и в каком состоянии придумал такое название.

P.S. Мои соболезнования Карену (многократный автор Mastering AWS CloudFormation) — опять всё переписывать.

#CloudFormation
😁11💯2🤮1