IoT TwinMaker Scene "Got empty scene url" Error with CloudFormation

0

Hello,

The context is as follow:

  • Creating IoT TwinMaker Scene resource via CloudFormation
TwinMakerScene:
    Type: AWS::IoTTwinMaker::Scene
    Properties:
      ContentLocation: !Sub s3://${MyBucketName}/
      SceneId: MySceneID
      WorkspaceId: !Ref TwinMakerWorkspace
  • TwinMakerWorkspace is defined on the same template
  • The CloudFormation Stack is created/updated successfully
  • The scene is created and shows up on the console
  • When I click on the scene on the console, I get an error message saying "Got empty scene url" and doesn't allow me to view the scene detail.

Could you help me figuring out what happening?

  • Edit:

    • When I create a new scene on the console, it creates a JSON file with some default contents in the S3 bucket that I set as the resource bucket (MyBucketName). However, when I create the scene through CloudFormation there is no JSON file created in the bucket. If I take the default JSON file content and create/upload in the resource bucket with the {Scene-ID-to-be}.json, and set the ContentLocation value under Properties as the "s3://{MyBucketName}/{Scene-ID-to-be}.json, then the scene resource is browsable without error. Although you can get around the error with the above solution, it defeats the purpose of automation ability of CloudFormation. Is there a way for me to make CloudFormation to automatically create and set the default content file upon TwinMaker Scene resource creation through CloudFormation?
JangHG
질문됨 일 년 전251회 조회
1개 답변
0

Hi JangHG,

Right, the ContentLocation property should point to a scene JSON file. The scene JSON file can be created either with the TwinMaker console as you discovered, or using the Scene SDK and uploaded to the S3 location.

To have CFN automatically create and set default content you'll probably want to explore an approach similar to our CookieFactoryV2 sample: basically we're using CDK and a custom resource to upload a sample Scene json file as an asset into the S3 location, so cdk deploy will create a fully-working digital twin in TwinMaker.

Hope that helps

Johnny

AWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인