AWS Cloudformation Debug - S3 Bucket

0

Hello everyone,

I'm using a sample AWS Cloudformation template: https://raw.githubusercontent.com/aws-samples/nonprofit-samples/main/Social_Media_Sentiment/sentiment_analysis.yml

It is from one of workshops from AWS Determining donor or stakeholder sentiment with AWS : https://catalog.us-east-1.prod.workshops.aws/workshops/e1fe5958-0970-4aba-b336-a6cd3919e4e4/en-US

However an error persists when the template is trying to identify S3 Bucket. I tried one with creating S3 bucket manullay, but then the template identifies S3 bucket and fails to proceed.

What approaches can I make on this stage?

Thank you, Kyle Ha

Enter image description here

1 Answer
0

Looks like the CloudFormation template that was shared tries to incorrectly create a resource without specifying the S3 bucket as a dependency. This causes the template to fail. Update the template with the fix below and it should work for your deployment.

The resource that was failing:

  TwitterSentimentCrawler:
    Type: AWS::Glue::Crawler
    Properties:
      DatabaseName: !Ref TwitterSentimentDatabase
      Role: !GetAtt GlueCrawlerPermissions.Arn
      Description: Crawler to crawl Twitter data
      Targets:
        S3Targets:
          - Path: !Sub s3://${AWS::StackName}-${AWS::AccountId}-${AWS::Region}-twitter/processed/entities/
          - Path: !Sub s3://${AWS::StackName}-${AWS::AccountId}-${AWS::Region}-twitter/processed/sentiment/
          - Path: !Sub s3://${AWS::StackName}-${AWS::AccountId}-${AWS::Region}-twitter/processed/keyphrases/
      RecrawlPolicy:
        RecrawlBehavior: CRAWL_NEW_FOLDERS_ONLY

The fix:

  TwitterSentimentCrawler:
    Type: AWS::Glue::Crawler
    Properties:
      DatabaseName: !Ref TwitterSentimentDatabase
      Role: !GetAtt GlueCrawlerPermissions.Arn
      Description: Crawler to crawl Twitter data
      Targets:
        S3Targets:
          - Path: !Sub s3://${TwitterBucket}/processed/entities/
          - Path: !Sub s3://${TwitterBucket}/processed/sentiment/
          - Path: !Sub s3://${TwitterBucket}/processed/keyphrases/
      RecrawlPolicy:
        RecrawlBehavior: CRAWL_NEW_FOLDERS_ONLY
profile pictureAWS
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions