本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/cloudformation.CloudFormation.ListStackResources方法的典型用法代码示例。如果您正苦于以下问题:Golang CloudFormation.ListStackResources方法的具体用法?Golang CloudFormation.ListStackResources怎么用?Golang CloudFormation.ListStackResources使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/aws/aws-sdk-go/service/cloudformation.CloudFormation
的用法示例。
在下文中一共展示了CloudFormation.ListStackResources方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: stackLambdaResources
func stackLambdaResources(serviceName string, cf *cloudformation.CloudFormation, logger *logrus.Logger) (provisionedResources, error) {
resources := make(provisionedResources, 0)
nextToken := ""
for {
params := &cloudformation.ListStackResourcesInput{
StackName: aws.String(serviceName),
}
if "" != nextToken {
params.NextToken = aws.String(nextToken)
}
resp, err := cf.ListStackResources(params)
if err != nil {
logger.Error(err.Error())
return nil, err
}
for _, eachSummary := range resp.StackResourceSummaries {
if *eachSummary.ResourceType == "AWS::Lambda::Function" {
resources = append(resources, eachSummary)
}
}
if nil != resp.NextToken {
nextToken = *resp.NextToken
} else {
break
}
}
return resources, nil
}
示例2: getStackResources
func getStackResources(svc *cloudformation.CloudFormation, stackID string) ([]cloudformation.StackResourceSummary, error) {
resources := make([]cloudformation.StackResourceSummary, 0)
req := cloudformation.ListStackResourcesInput{
StackName: aws.String(stackID),
}
for {
resp, err := svc.ListStackResources(&req)
if err != nil {
return nil, err
}
for _, s := range resp.StackResourceSummaries {
resources = append(resources, *s)
}
req.NextToken = resp.NextToken
if aws.StringValue(req.NextToken) == "" {
break
}
}
return resources, nil
}