AWS Makes Cloud Formation Stack Creation up to 40% Faster

AWS optimized the stack creation process to make it faster and achieved significant improvements. The company split the resource creation process into two phases (creation and stabilization), which allows for creating other resources in the stack earlier. The change is available in all regions and doesn’t require any user action.

Previously the stack provisioning process of AWS Cloud Formation (CF) combined all tasks involved in resource provisioning into a single step. For each resource in the stack, Cloud Formation would emit CREATE_IN_PROGRESS and CREATE_COMPLETE events at the start and end of the provisioning process. Internally, however, CF would request resource creation from the relevant service and then wait for the resource to be ready for use (created and stable).

Bhavani Kanneganti, principal engineer at AWS Support, and Idriss Laouali Abdou, senior product manager at AWS, explain the need for resource stabilization:

When provisioning AWS resources, CloudFormation makes the necessary API calls to the underlying services to create the resources. After creation, CloudFormation then performs eventual consistency checks to ensure the resources are ready to process the intended traffic, a process known as resource stabilization. [...] Resource stabilization is not unique to CloudFormation and must be handled to some degree by all IaC tools.

The original approach ensured that all dependent resources were ready for use before creating any new resource, but always waiting for the stabilization introduced delays and made stack creation longer than necessary in most cases. The team opted to separate resource creation (requesting new resources from AWS services) and resource stabilization (waiting for the resource to be ready for use) into distinct phases and optimistically start creating further resources in the stack once the creation phase was completed.

The new optimized resource provisioning strategy additionally has a retry capability. If resource creation fails, it is retried once the stabilization phase of the dependent resource is completed.

The New Stack Provisioning Strategy with Retry (Source: AWS DevOps Blog)

Cloud Formation selects the appropriate provisioning strategy based on the type of dependency between resources. For implicit dependencies, where one resource depends on another using an intrinsic function (like Fn::GetAtt and Ref), the new strategy is used. For explicit dependencies (those with the DependsOn attribute), the previous strategy that includes resource stabilization is used to ensure the resource is ready.

With the changes, CF introduced a new CONFIGURATION_COMPLETE event, emitted once the creation phase of resource provisioning completes. The event is used internally to orchestrate the stack provisioning but can also be used directly by clients to speed up the creation of further resources or stacks if resource consistency checks are unnecessary, for example, when validating pre-production stack configurations.

New CONFIGURATION_COMPLETE Events in Stack Creation Log (Source: AWS DevOps Blog)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值