aws-amplify / amplify-backend

Home to all tools related to Amplify's code-first DX (Gen 2) for building fullstack apps on AWS
Apache License 2.0
174 stars 60 forks source link

amplify_outputs.json not updating after schema changes #1768

Closed dan-whitehouse closed 3 months ago

dan-whitehouse commented 3 months ago

Environment information

System:
  OS: Windows 10 10.0.19045
  CPU: (12) x64 Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
  Memory: 17.44 GB / 31.91 GB
Binaries:
  Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
  Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
  npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/backend: 1.0.4
  @aws-amplify/backend-cli: 1.2.0
  aws-amplify: 6.4.1
  aws-cdk: 2.149.0
  aws-cdk-lib: 2.149.0
  typescript: 5.5.3
AWS environment variables:
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
  AWS_STS_REGIONAL_ENDPOINTS = regional
No CDK environment variables

Description

So I could be misunderstanding how this is supposed to work, as I'm just starting out with Amplify Gen 2, but I thought that when running npx ampx sandbox any changes made in the amplify folder would be tracked and changed.

That however doesn't seem to be the case.

So I decided to start the sandbox in debug mode npx ampx sandbox --debug

To specify a different sandbox identifier, use --identifier
[DEBUG] 2024-07-21T02:20:07.909Z: [Sandbox] Executing command `deploy`
[DEBUG] 2024-07-21T02:20:18.860Z: Bundling asset amplify-reactionvideo-Dan-sandbox-a13e4122ce/auth/SecretFetcherResourceProviderLambda/Code/Stage...

[DEBUG] 2024-07-21T02:20:20.928Z: 
  ...d715244b04425617249f7f5fa8e99b51029141ba15a0aff83143d24\index.js  241.5kb

[DEBUG] 2024-07-21T02:20:20.929Z: Done in 46ms

[DEBUG] 2024-07-21T02:20:22.134Z: WARNING: Schema is using an @auth directive with deprecated provider 'iam'. Replace 'iam' provider with 'identityPool' provider.

[DEBUG] 2024-07-21T02:20:23.731Z: 

[DEBUG] 2024-07-21T02:20:25.498Z: {
    "compilerOptions": {
        "target": "es2022",
        "module": "es2022",
        "moduleResolution": "bundler",
        "resolveJsonModule": true,
        "esModuleInterop": true,
        "forceConsistentCasingInFileNames": true,
        "strict": true,
        "skipLibCheck": true,
        "paths": {
            "$amplify/*": [
                "../.amplify/generated/*"
            ]
        },
        "allowSyntheticDefaultImports": true,
        "resolvePackageJsonExports": true,
        "resolvePackageJsonImports": true,
        "useDefineForClassFields": true,
        "noImplicitAny": true,
        "noImplicitThis": true,
        "strictNullChecks": true,
        "strictFunctionTypes": true,
        "strictBindCallApply": true,
        "strictPropertyInitialization": true,
        "alwaysStrict": true,
        "useUnknownInCatchVariables": true
    },
    "files": [
        "./backend.ts",
        "./auth/resource.ts",
        "./data/models.ts",
        "./data/queries.ts",
        "./data/resource.ts"
    ]
}

[DEBUG] 2024-07-21T02:20:36.875Z: 
✨  Synthesis time: 0.65s

✨  Synthesis time: 0.65s

[DEBUG] 2024-07-21T02:20:36.876Z: ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
⚠️ They should only be used for development - never use them for your production Stacks!

⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
⚠️ They should only be used for development - never use them for your production Stacks!

[DEBUG] 2024-07-21T02:20:38.820Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce: deploying... [1/1]

amplify-reactionvideo-Dan-sandbox-a13e4122ce: deploying... [1/1]
[DEBUG] 2024-07-21T02:20:39.134Z: 
 ✨ hotswap deployment skipped - no changes were detected (use --force to override)

 ✨ hotswap deployment skipped - no changes were detected (use --force to override)

[DEBUG] 2024-07-21T02:20:39.135Z:
 ✅  amplify-reactionvideo-Dan-sandbox-a13e4122ce (no changes)

✨  Deployment time: 0.31s

Outputs:
amplify-reactionvideo-Dan-sandbox-a13e4122ce.allowUnauthenticatedIdentities = true
amplify-reactionvideo-Dan-sandbox-a13e4122ce.amplifyApiModelSchemaS3Uri = s3://amplify-reactionvideo-dan-amplifydataamplifycodege-ql8a9qym9lbk/model-schema.graphql
amplify-reactionvideo-Dan-sandbox-a13e4122ce.authRegion = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncAdditionalAuthenticationTypes = AWS_IAM
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncApiEndpoint = https://pjxfaj3mabfnlmxgicuiqbxk5q.appsync-api.us-east-1.amazonaws.com/graphql
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncApiId = hyhqs7pwkncq3cb2mougkuehme
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncAuthenticationType = AMAZON_COGNITO_USER_POOLS
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncRegion = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.deploymentType = sandbox
amplify-reactionvideo-Dan-sandbox-a13e4122ce.identityPoolId = us-east-1:5a0d1f39-3c55-4e44-bc7f-6e4f16e9184d
amplify-reactionvideo-Dan-sandbox-a13e4122ce.mfaConfiguration = OFF
amplify-reactionvideo-Dan-sandbox-a13e4122ce.mfaTypes = []
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthClientId = 5q68s1hp45oktfidlugnobkqk
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthCognitoDomain = c5a3674952cbd472563d.auth.us-east-1.amazoncognito.com
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthRedirectSignIn = https://reaction.video/auth/redirect,https://dev.reaction.video:5173/auth/redirect
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthRedirectSignOut = https://reaction.video,https://dev.reaction.video:5173
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthResponseType = code
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthScope = ["phone","email","openid","profile","aws.cognito.signin.user.admin"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.passwordPolicyMinLength = 8
amplify-reactionvideo-Dan-sandbox-a13e4122ce.passwordPolicyRequirements = ["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.region = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.signupAttributes = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.socialProviders = ["GOOGLE"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.userPoolId = us-east-1_zqZHbprQa
amplify-reactionvideo-Dan-sandbox-a13e4122ce.usernameAttributes = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.verificationMechanisms = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.webClientId = 5q68s1hp45oktfidlugnobkqk
Stack ARN:
arn:aws:cloudformation:us-east-1:905418448308:stack/amplify-reactionvideo-Dan-sandbox-a13e4122ce/a12a0da0-46fe-11ef-9d79-0ebb0073c95b

✨  Total time: 0.97s

 ✅  amplify-reactionvideo-Dan-sandbox-a13e4122ce (no changes)

✨  Deployment time: 0.31s

Outputs:
amplify-reactionvideo-Dan-sandbox-a13e4122ce.allowUnauthenticatedIdentities = true
amplify-reactionvideo-Dan-sandbox-a13e4122ce.amplifyApiModelSchemaS3Uri = s3://amplify-reactionvideo-dan-amplifydataamplifycodege-ql8a9qym9lbk/model-schema.graphql
amplify-reactionvideo-Dan-sandbox-a13e4122ce.authRegion = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncAdditionalAuthenticationTypes = AWS_IAM
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncApiEndpoint = https://pjxfaj3mabfnlmxgicuiqbxk5q.appsync-api.us-east-1.amazonaws.com/graphql
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncApiId = hyhqs7pwkncq3cb2mougkuehme
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncAuthenticationType = AMAZON_COGNITO_USER_POOLS
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncRegion = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.deploymentType = sandbox
amplify-reactionvideo-Dan-sandbox-a13e4122ce.identityPoolId = us-east-1:5a0d1f39-3c55-4e44-bc7f-6e4f16e9184d
amplify-reactionvideo-Dan-sandbox-a13e4122ce.mfaConfiguration = OFF
amplify-reactionvideo-Dan-sandbox-a13e4122ce.mfaTypes = []
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthClientId = 5q68s1hp45oktfidlugnobkqk
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthCognitoDomain = c5a3674952cbd472563d.auth.us-east-1.amazoncognito.com
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthRedirectSignIn = https://reaction.video/auth/redirect,https://dev.reaction.video:5173/auth/redirect
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthRedirectSignOut = https://reaction.video,https://dev.reaction.video:5173
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthResponseType = code
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthScope = ["phone","email","openid","profile","aws.cognito.signin.user.admin"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.passwordPolicyMinLength = 8
amplify-reactionvideo-Dan-sandbox-a13e4122ce.passwordPolicyRequirements = ["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.region = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.signupAttributes = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.socialProviders = ["GOOGLE"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.userPoolId = us-east-1_zqZHbprQa
amplify-reactionvideo-Dan-sandbox-a13e4122ce.usernameAttributes = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.verificationMechanisms = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.webClientId = 5q68s1hp45oktfidlugnobkqk
Stack ARN:
arn:aws:cloudformation:us-east-1:905418448308:stack/amplify-reactionvideo-Dan-sandbox-a13e4122ce/a12a0da0-46fe-11ef-9d79-0ebb0073c95b

✨  Total time: 0.97s

[DEBUG] 2024-07-21T02:20:39.247Z: 

[DEBUG] 2024-07-21T02:20:39.321Z: [Sandbox] Deployment successful
[INFO] 2024-07-21T02:20:39.323Z: [Sandbox] Watching for file changes...
[INFO] 2024-07-21T02:20:40.423Z: File written: amplify_outputs.json

So you can see that it says there were no changes, however the file is very different. amplify_outputs.json has a Todo table which is no longer specified in amplify\data\resource.ts schema, nor is it defined in my models.ts. As you can also see, the items marked in yellow are not included.

Capture

I've tried deleting the entire sandbox ( npx ampx sandbox --debug Ctrl+C y ) and then rebuilt it (npx ampx sandbox) and what was generated in the 'amplify_outputs.json' is what is shown in the screenshot.

If I am doing something wrong, and this isn't a bug please let me know what I can do fix this on my end.

Thanks

dan-whitehouse commented 3 months ago

I just wanted to add the log for recreating the sandbox.

Terminate batch job (Y/N)? y
PS C:\Users\Dan\IdeaProjects\reactor> npx ampx sandbox --profile reaction --debug
[INFO] 2024-07-21T02:52:30.235Z:   
Amplify Sandbox

[INFO] 2024-07-21T02:52:30.235Z:   Identifier:  Dan
[INFO] 2024-07-21T02:52:30.235Z:   Stack:       amplify-reactionvideo-Dan-sandbox-a13e4122ce
[INFO] 2024-07-21T02:52:30.236Z:
To specify a different sandbox identifier, use --identifier
[DEBUG] 2024-07-21T02:52:30.273Z: [Sandbox] Executing command `deploy`
[DEBUG] 2024-07-21T02:52:40.665Z: Bundling asset amplify-reactionvideo-Dan-sandbox-a13e4122ce/auth/SecretFetcherResourceProviderLambda/Code/Stage...

[DEBUG] 2024-07-21T02:52:42.631Z: 
  ...d715244b04425617249f7f5fa8e99b51029141ba15a0aff83143d24\
[DEBUG] 2024-07-21T02:52:42.631Z: index.js  241.5kb

Done in 33ms

[DEBUG] 2024-07-21T02:52:43.701Z: WARNING: Schema is using an @auth directive with deprecated provider 'iam'. Replace 'iam' provider with 'identityPool' provider.

[DEBUG] 2024-07-21T02:52:45.180Z: 

[DEBUG] 2024-07-21T02:52:46.965Z: {
    "compilerOptions": {
        "target": "es2022",
        "module": "es2022",
        "moduleResolution": "bundler",
        "resolveJsonModule": true,
        "esModuleInterop": true,
        "forceConsistentCasingInFileNames": true,
        "strict": true,
        "skipLibCheck": true,
        "paths": {
            "$amplify/*": [
                "../.amplify/generated/*"
            ]
        },
        "allowSyntheticDefaultImports": true,
        "resolvePackageJsonExports": true,
        "resolvePackageJsonImports": true,
        "useDefineForClassFields": true,
        "noImplicitAny": true,
        "noImplicitThis": true,
        "strictNullChecks": true,
        "strictFunctionTypes": true,
        "strictBindCallApply": true,
        "strictPropertyInitialization": true,
        "alwaysStrict": true,
        "useUnknownInCatchVariables": true
    },
    "files": [
        "./backend.ts",
        "./auth/resource.ts",
        "./data/models.ts",
        "./data/resource.ts"
    ]
}

[DEBUG] 2024-07-21T02:52:58.063Z: 
✨  Synthesis time: 0.65s

✨  Synthesis time: 0.65s

[DEBUG] 2024-07-21T02:52:58.064Z: ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
⚠️ They should only be used for development - never use them for your production Stacks!

⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
⚠️ They should only be used for development - never use them for your production Stacks!

[DEBUG] 2024-07-21T02:53:00.246Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce: deploying... [1/1]

amplify-reactionvideo-Dan-sandbox-a13e4122ce: deploying... [1/1]
[DEBUG] 2024-07-21T02:53:00.818Z: 
⚠️ The following non-hotswappable changes were found:
    logicalID: deploymentType, type: Stack Output, reason: output was changed

⚠️ The following non-hotswappable changes were found:
    logicalID: deploymentType, type: Stack Output, reason: output was changed
[DEBUG] 2024-07-21T02:53:00.820Z:     logicalID: region, type: Stack Output, reason: output was changed
    logicalID: userPoolId, type: Stack Output, reason: output was changed
    logicalID: webClientId, type: Stack Output, reason: output was changed
    logicalID: identityPoolId, type: Stack Output, reason: output was changed
    logicalID: authRegion, type: Stack Output, reason: output was changed
    logicalID: allowUnauthenticatedIdentities, type: Stack Output, reason: output was changed
    logicalID: signupAttributes, type: Stack Output, reason: output was changed
    logicalID: usernameAttributes, type: Stack Output, reason: output was changed
    logicalID: verificationMechanisms, type: Stack Output, reason: output was changed
    logicalID: passwordPolicyMinLength, type: Stack Output, reason: output was changed
    logicalID: passwordPolicyRequirements, type: Stack Output, reason: output was changed
    logicalID: mfaConfiguration, type: Stack Output, reason: output was changed
    logicalID: mfaTypes, type: Stack Output, reason: output was changed
    logicalID: socialProviders, type: Stack Output, reason: output was changed
    logicalID: oauthCognitoDomain, type: Stack Output, reason: output was changed
    logicalID: oauthScope, type: Stack Output, reason: output was changed
    logicalID: oauthRedirectSignIn, type: Stack Output, reason: output was changed
    logicalID: oauthRedirectSignOut, type: Stack Output, reason: output was changed
    logicalID: oauthResponseType, type: Stack Output, reason: output was changed
    logicalID: oauthClientId, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncApiId, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncApiEndpoint, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncAuthenticationType, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncRegion, type: Stack Output, reason: output was changed
    logicalID: amplifyApiModelSchemaS3Uri, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncAdditionalAuthenticationTypes, type: Stack Output, reason: output was changed
    logicalID: auth179371D7, type: AWS::CloudFormation::Stack, reason: resource 'auth179371D7' was created by this deployment
    logicalID: data7552DF31, type: AWS::CloudFormation::Stack, reason: resource 'data7552DF31' was created by this deployment
    logicalID: CDKMetadata, type: AWS::CDK::Metadata, reason: resource 'CDKMetadata' was created by this deployment

Could not perform a hotswap deployment, as the stack amplify-reactionvideo-Dan-sandbox-a13e4122ce contains non-Asset changes
Falling back to doing a full deployment

    logicalID: region, type: Stack Output, reason: output was changed
    logicalID: userPoolId, type: Stack Output, reason: output was changed
    logicalID: webClientId, type: Stack Output, reason: output was changed
    logicalID: identityPoolId, type: Stack Output, reason: output was changed
    logicalID: authRegion, type: Stack Output, reason: output was changed
    logicalID: allowUnauthenticatedIdentities, type: Stack Output, reason: output was changed
    logicalID: signupAttributes, type: Stack Output, reason: output was changed
    logicalID: usernameAttributes, type: Stack Output, reason: output was changed
    logicalID: verificationMechanisms, type: Stack Output, reason: output was changed
    logicalID: passwordPolicyMinLength, type: Stack Output, reason: output was changed
    logicalID: passwordPolicyRequirements, type: Stack Output, reason: output was changed
    logicalID: mfaConfiguration, type: Stack Output, reason: output was changed
    logicalID: mfaTypes, type: Stack Output, reason: output was changed
    logicalID: socialProviders, type: Stack Output, reason: output was changed
    logicalID: oauthCognitoDomain, type: Stack Output, reason: output was changed
    logicalID: oauthScope, type: Stack Output, reason: output was changed
    logicalID: oauthRedirectSignIn, type: Stack Output, reason: output was changed
    logicalID: oauthRedirectSignOut, type: Stack Output, reason: output was changed
    logicalID: oauthResponseType, type: Stack Output, reason: output was changed
    logicalID: oauthClientId, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncApiId, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncApiEndpoint, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncAuthenticationType, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncRegion, type: Stack Output, reason: output was changed
    logicalID: amplifyApiModelSchemaS3Uri, type: Stack Output, reason: output was changed
    logicalID: awsAppsyncAdditionalAuthenticationTypes, type: Stack Output, reason: output was changed
    logicalID: auth179371D7, type: AWS::CloudFormation::Stack, reason: resource 'auth179371D7' was created by this deployment
    logicalID: data7552DF31, type: AWS::CloudFormation::Stack, reason: resource 'data7552DF31' was created by this deployment
    logicalID: CDKMetadata, type: AWS::CDK::Metadata, reason: resource 'CDKMetadata' was created by this deployment

Could not perform a hotswap deployment, as the stack amplify-reactionvideo-Dan-sandbox-a13e4122ce contains non-Asset changes
Falling back to doing a full deployment
[DEBUG] 2024-07-21T02:53:00.824Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce: creating stack...

amplify-reactionvideo-Dan-sandbox-a13e4122ce: creating stack...
[DEBUG] 2024-07-21T02:53:06.985Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce-auth179371D7-MXAYMRMZKTUZ |   0 | 10:53:07 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | amplify-reactionvideo-Dan-sandbox-a13e4122ce-auth179371D7-MXAYMRMZKTUZ User Initiated

amplify-reactionvideo-Dan-sandbox-a13e4122ce-auth179371D7-MXAYMRMZKTUZ |   0 | 10:53:07 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | amplify-reactionvideo-Dan-sandbox-a13e4122ce-auth179371D7-MXAYMRMZKTUZ User Initiated       
[DEBUG] 2024-07-21T02:53:07.147Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:02 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | amplify-reactionvideo-Dan-sandbox-a13e4122ce User Initiated

amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:02 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | amplify-reactionvideo-Dan-sandbox-a13e4122ce User Initiated
[DEBUG] 2024-07-21T02:53:07.147Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:06 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | auth.NestedStack/auth.NestedStackResource (auth179371D7)
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:06 PM | CREATE_IN_PROGRESS   | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata)
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:07 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | auth.NestedStack/auth.NestedStackResource (auth179371D7) Resource creation Initiated
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:07 PM | CREATE_IN_PROGRESS   | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata) Resource creation Initiated
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   1 | 10:53:07 PM | CREATE_COMPLETE      | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata)

amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:06 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | auth.NestedStack/auth.NestedStackResource (auth179371D7)
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:06 PM | CREATE_IN_PROGRESS   | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata)
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:07 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | auth.NestedStack/auth.NestedStackResource (auth179371D7) Resource creation Initiated
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   0 | 10:53:07 PM | CREATE_IN_PROGRESS   | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata) Resource creation Initiated
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   1 | 10:53:07 PM | CREATE_COMPLETE      | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata)
[DEBUG] 2024-07-21T02:53:38.033Z:   1 Currently in progress: amplify-reactionvideo-Dan-sandbox-a13e4122ce-auth179371D7-MXAYMRMZKTUZ, amplify-reactionvideo-Dan-sandbox-a13e4122ce, auth179371D7

  1 Currently in progress: amplify-reactionvideo-Dan-sandbox-a13e4122ce-auth179371D7-MXAYMRMZKTUZ, amplify-reactionvideo-Dan-sandbox-a13e4122ce, auth179371D7  
[DEBUG] 2024-07-21T02:55:00.578Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce |   2 | 10:55:00 PM | CREATE_COMPLETE      | AWS::CloudFormation::Stack | auth.NestedStack/auth.NestedStackResource (auth179371D7)

amplify-reactionvideo-Dan-sandbox-a13e4122ce |   2 | 10:55:00 PM | CREATE_COMPLETE      | AWS::CloudFormation::Stack | auth.NestedStack/auth.NestedStackResource (auth179371D7)
[DEBUG] 2024-07-21T02:55:00.578Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce |   2 | 10:55:01 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | data.NestedStack/data.NestedStackResource (data7552DF31)

amplify-reactionvideo-Dan-sandbox-a13e4122ce |   2 | 10:55:01 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | data.NestedStack/data.NestedStackResource (data7552DF31)
[DEBUG] 2024-07-21T02:55:05.924Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce-data7552DF31-B1U8INU72061 |   2 | 10:55:01 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | amplify-reactionvideo-Dan-sandbox-a13e4122ce-data7552DF31-B1U8INU72061 User Initiated

amplify-reactionvideo-Dan-sandbox-a13e4122ce-data7552DF31-B1U8INU72061 |   2 | 10:55:01 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | amplify-reactionvideo-Dan-sandbox-a13e4122ce-data7552DF31-B1U8INU72061 User Initiated
[DEBUG] 2024-07-21T02:55:05.925Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce |   2 | 10:55:02 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | data.NestedStack/data.NestedStackResource (data7552DF31) Resource creation Initiated
amplify-reactionvideo-Dan-sandbox-a13e4122ce |   2 | 10:55:02 PM | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | data.NestedStack/data.NestedStackResource (data7552DF31) Resource creation Initiated
[DEBUG] 2024-07-21T02:55:37.000Z:   2 Currently in progress: amplify-reactionvideo-Dan-sandbox-a13e4122ce-auth179371D7-MXAYMRMZKTUZ, amplify-reactionvideo-Dan-sandbox-a13e4122ce, data7552DF31, amplify-reactionvideo-Dan-sandbox-a13e4122ce-data7552DF31-B1U8INU72061

   2 Currently in progress: amplify-reactionvideo-Dan-sandbox-a13e4122ce-auth179371D7-MXAYMRMZKTUZ, amplify-reactionvideo-Dan-sandbox-a13e4122ce, data7552DF31, amplify-reactionvideo-Dan-sandbox-a13e4122ce-data7552DF31-B1U8INU72061
[DEBUG] 2024-07-21T02:57:39.996Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce |   3 | 10:57:39 PM | CREATE_COMPLETE      | AWS::CloudFormation::Stack | data.NestedStack/data.NestedStackResource (data7552DF31) 

amplify-reactionvideo-Dan-sandbox-a13e4122ce |   3 | 10:57:39 PM | CREATE_COMPLETE      | AWS::CloudFormation::Stack | data.NestedStack/data.NestedStackResource (data7552DF31) 
[DEBUG] 2024-07-21T02:57:39.997Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce |   4 | 10:57:40 PM | CREATE_COMPLETE      | AWS::CloudFormation::Stack | amplify-reactionvideo-Dan-sandbox-a13e4122ce 

amplify-reactionvideo-Dan-sandbox-a13e4122ce |   4 | 10:57:40 PM | CREATE_COMPLETE      | AWS::CloudFormation::Stack | amplify-reactionvideo-Dan-sandbox-a13e4122ce
[DEBUG] 2024-07-21T02:57:39.998Z:
 ✅  amplify-reactionvideo-Dan-sandbox-a13e4122ce

✨  Deployment time: 279.75s

Outputs:
amplify-reactionvideo-Dan-sandbox-a13e4122ce.allowUnauthenticatedIdentities = true
amplify-reactionvideo-Dan-sandbox-a13e4122ce.amplifyApiModelSchemaS3Uri = s3://amplify-reactionvideo-dan-amplifydataamplifycodege-9ui3mydbsqvd/model-schema.graphql
amplify-reactionvideo-Dan-sandbox-a13e4122ce.authRegion = us-east-1

 ✅  amplify-reactionvideo-Dan-sandbox-a13e4122ce

✨  Deployment time: 279.75s

Outputs:
amplify-reactionvideo-Dan-sandbox-a13e4122ce.allowUnauthenticatedIdentities = true
amplify-reactionvideo-Dan-sandbox-a13e4122ce.amplifyApiModelSchemaS3Uri = s3://amplify-reactionvideo-dan-amplifydataamplifycodege-9ui3mydbsqvd/model-schema.graphql
amplify-reactionvideo-Dan-sandbox-a13e4122ce.authRegion = us-east-1
[DEBUG] 2024-07-21T02:57:40.000Z: amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncAdditionalAuthenticationTypes = AWS_IAM
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncApiEndpoint = https://uaonj4vocvatlonmmc6su67bom.appsync-api.us-east-1.amazonaws.com/graphql
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncApiId = myelfk42rzdvjmvihly5lzhwku
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncAuthenticationType = AMAZON_COGNITO_USER_POOLS
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncRegion = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.deploymentType = sandbox
amplify-reactionvideo-Dan-sandbox-a13e4122ce.identityPoolId = us-east-1:4a4e123d-1591-44e8-ae0a-3085da02ebb3
amplify-reactionvideo-Dan-sandbox-a13e4122ce.mfaConfiguration = OFF
amplify-reactionvideo-Dan-sandbox-a13e4122ce.mfaTypes = []
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthClientId = 2omafq1e1jsqmq41qqvaqjsf23
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthCognitoDomain = c5a3674952cbd472563d.auth.us-east-1.amazoncognito.com
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthRedirectSignIn = https://reaction.video/auth/redirect,https://dev.reaction.video:5173/auth/redirect
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthRedirectSignOut = https://reaction.video,https://dev.reaction.video:5173
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthResponseType = code
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthScope = ["phone","email","openid","profile","aws.cognito.signin.user.admin"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.passwordPolicyMinLength = 8
amplify-reactionvideo-Dan-sandbox-a13e4122ce.passwordPolicyRequirements = ["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]    
amplify-reactionvideo-Dan-sandbox-a13e4122ce.region = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.signupAttributes = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.socialProviders = ["GOOGLE"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.userPoolId = us-east-1_fsmv4wtJC
amplify-reactionvideo-Dan-sandbox-a13e4122ce.usernameAttributes = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.verificationMechanisms = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.webClientId = 2omafq1e1jsqmq41qqvaqjsf23
Stack ARN:
arn:aws:cloudformation:us-east-1:905418448308:stack/amplify-reactionvideo-Dan-sandbox-a13e4122ce/5883ff80-470c-11ef-a3d7-0e9d1c4e0425

✨  Total time: 280.4s

amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncAdditionalAuthenticationTypes = AWS_IAM
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncApiEndpoint = https://uaonj4vocvatlonmmc6su67bom.appsync-api.us-east-1.amazonaws.com/graphql
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncApiId = myelfk42rzdvjmvihly5lzhwku
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncAuthenticationType = AMAZON_COGNITO_USER_POOLS
amplify-reactionvideo-Dan-sandbox-a13e4122ce.awsAppsyncRegion = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.deploymentType = sandbox
amplify-reactionvideo-Dan-sandbox-a13e4122ce.identityPoolId = us-east-1:4a4e123d-1591-44e8-ae0a-3085da02ebb3
amplify-reactionvideo-Dan-sandbox-a13e4122ce.mfaConfiguration = OFF
amplify-reactionvideo-Dan-sandbox-a13e4122ce.mfaTypes = []
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthClientId = 2omafq1e1jsqmq41qqvaqjsf23
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthCognitoDomain = c5a3674952cbd472563d.auth.us-east-1.amazoncognito.com
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthRedirectSignIn = https://reaction.video/auth/redirect,https://dev.reaction.video:5173/auth/redirect
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthRedirectSignOut = https://reaction.video,https://dev.reaction.video:5173
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthResponseType = code
amplify-reactionvideo-Dan-sandbox-a13e4122ce.oauthScope = ["phone","email","openid","profile","aws.cognito.signin.user.admin"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.passwordPolicyMinLength = 8
amplify-reactionvideo-Dan-sandbox-a13e4122ce.passwordPolicyRequirements = ["REQUIRES_NUMBERS","REQUIRES_LOWERCASE","REQUIRES_UPPERCASE","REQUIRES_SYMBOLS"]    
amplify-reactionvideo-Dan-sandbox-a13e4122ce.region = us-east-1
amplify-reactionvideo-Dan-sandbox-a13e4122ce.signupAttributes = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.socialProviders = ["GOOGLE"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.userPoolId = us-east-1_fsmv4wtJC
amplify-reactionvideo-Dan-sandbox-a13e4122ce.usernameAttributes = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.verificationMechanisms = ["email"]
amplify-reactionvideo-Dan-sandbox-a13e4122ce.webClientId = 2omafq1e1jsqmq41qqvaqjsf23
Stack ARN:
arn:aws:cloudformation:us-east-1:905418448308:stack/amplify-reactionvideo-Dan-sandbox-a13e4122ce/5883ff80-470c-11ef-a3d7-0e9d1c4e0425

✨  Total time: 280.4s

[DEBUG] 2024-07-21T02:57:40.149Z: 

[DEBUG] 2024-07-21T02:57:40.252Z: [Sandbox] Deployment successful
[INFO] 2024-07-21T02:57:40.254Z: [Sandbox] Watching for file changes...
[INFO] 2024-07-21T02:57:41.396Z: File written: amplify_outputs.json

As I was reading these logs I noticed this line s3://amplify-reactionvideo-dan-amplifydataamplifycodege-9ui3mydbsqvd/model-schema.graphql so I went to s3 and looked for the file.

enum MediaType {
  image
  video
  audio
  text
  other
}

enum SourceType {
  db
  genius
  spotify
  youtube
  other
}

type User @model @auth(rules: [{allow: groups, groups: ["dev"]},
  {allow: owner, operations: [read, update, delete], ownerField: "owner"},
  {allow: private, operations: [read]}])
{
  id: ID! @primaryKey
  displayName: String
  roles: [UserRole] @hasMany(references: ["userId"]) @auth(rules: [{allow: groups, groups: ["dev"]},
  {allow: private, operations: [read]}])
  computed: AWSJSON
  owner: String @auth(rules: [{allow: owner, operations: [read, delete], ownerField: "owner"}])
  createdAt: AWSDateTime
  updatedAt: AWSDateTime
}

type UserRole @model @auth(rules: [{allow: groups, groups: ["dev"]},
  {allow: private, operations: [read]}])
{
  id: ID! @primaryKey
  userId: ID!
  roleId: ID!
  user: User @belongsTo(references: ["userId"])
  role: Role @belongsTo(references: ["roleId"])
}

type Role @model @auth(rules: [{allow: groups, groups: ["dev"]},
  {allow: private, operations: [read]}])
{
  id: ID! @primaryKey
  displayName: String
  roles: [UserRole] @hasMany(references: ["roleId"])
}

type Artist @model @auth(rules: [{allow: groups, groups: ["dev"]},
  {allow: groups, operations: [create, read, update], groups: ["contributor"]},
  {allow: private, operations: [read]}])
{
  id: ID! @primaryKey
  name: String
  aliases: [String]
  media: ArtistMedia
  sources: ExternalSources
  createdAt: AWSDateTime
  updatedAt: AWSDateTime
  computed: AWSJSON
}

type Todo @model @auth(rules: [{allow: public, provider: iam}])
{
  content: String
}

type Media 
{
  key: String
  url: String
  type: MediaType
  source: SourceType
}

type ExternalSource 
{
  id: String
  lastSync: AWSDateTime
  url: String
  media: [Media]
}

type ExternalSources 
{
  genius: ExternalSource
  spotify: ExternalSource
  youtube: ExternalSource
  wikipedia: ExternalSource
}

type ArtistMedia 
{
  profile: Media
  banner: Media
}

So my follow up question is, why is when the sandbox get deleted the s3 file also isn't being cleared out? Or if it that it can't be deleted because it's being used by the deployed version? Why does the sandbox reference that file instead of just generating a new schema from the local definition?

dan-whitehouse commented 3 months ago

I figured out my issue. For some reason my typescript wasn't recompiling on save (which it is set up to do). Manually compiling, fixed the issue.