在 AWS CloudFormation 中定义表、视图和索引 [英] Defining Tables, Views, and Indexes in AWS CloudFormation

查看:28
本文介绍了在 AWS CloudFormation 中定义表、视图和索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 AWS CloudFormation 中,您可以使用 JSON/YAML 模板定义一系列服务.特别是,我正在使用 RedshiftAurora 集群.

In AWS CloudFormation, you can define a stack of services with a JSON/YAML template. In particular, I am using Redshift and Aurora clusters.

模板允许您定义集群的管理属性,但似乎没有明确的方法来定义集群中的表、视图和索引,以便当我推送堆栈更新时,数据库会自动更新模式根据需要,类似于管理更新到完整堆栈的方式.

The template allows you to define administrative properties of the cluster, but there doesn't seem to be a clear way to define tables, views, and indexes in the cluster such that when I push updates of stack, the DB's automatically update the schema as needed, similar to the way it manages updates to full stacks.

有没有办法在 Cloud Formation 中管理 Redshift 和 Aurora 数据库的架构?

Is there a way to manage the schema of Redshift and Aurora databases in Cloud Formation?

推荐答案

工作正在进行中!!我会在确定它正常工作后更新!

Work in Progess!! I'll update once I am sure that it is working!

因此抓取文档、Github 和与 AWS 的一个小时聊天收益,我可能需要创建一个 父子栈 (示例模板).父堆栈将包含一个 SNS 主题SNS 订阅和监控孩子的 Lambda 函数堆栈.

So crawling documentation, Github and an hour on chat with AWS yields that I might need to create a parent and child stack (example templates). The parent stack would contain a SNS Topic, SNS Subscription and Lambda Function that monitor the child stack.

父堆栈可能看起来像,

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  StackEventTopic:
    Type: AWS::SNS::Topic

  StackEventEmailSubscription:
    Type: AWS::SNS::Subscription
    Properties:
      Protocol: email
      Endpoint: <your email>@gmail.com
      TopicArn:
        Ref: StackEventTopic

  StackEventLambdaSubscription:
    Type: AWS::SNS::Subscription
    Properties:
      Protocol: lambda
      Endpoint:
        Ref: StackEventHandler
      TopicArn:
        Ref: StackEventTopic

  StackEventHandler:
    Type: AWS::Lambda::Function
    Properties:
      ... configure your Lambda ...

  ChildStack:
    Type: AWS::CloudFormation::Stack
    Properties:
      NotificationARNs:
        Ref: StackEventTopic
      TemplateURL: "s3 url for template YAML"

这篇关于在 AWS CloudFormation 中定义表、视图和索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆