Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters: [S3DeploymentBucket, S3DeploymentRootKey] must have values into the development of a new plugin #1517

Closed
paciops opened this issue May 30, 2023 · 4 comments
Labels
extensibility question Further information is requested

Comments

@paciops
Copy link

paciops commented May 30, 2023

Amplify CLI Version

12.0.3

Question

I am trying to develop a new plugin that will works like Searchable and Algolia.
I created a class OramaSearchableTransformer that extends TransformerPluginBase and implements TransformerPluginProvider.
At the moment I am testing this plugin in a basic Amplify app with a schema like this

type Todo @model {
  id: ID!
  name: String!
}

type User @model @oramaSearchable(schema:{
  id: string,
  name: string
}) {
  id: ID!,
  name: String!
}

the plugin is imported via the /amplify/backend/api/<API_NAME>/transform.conf.json file, the command amplify api gql-compile works fine, but when i try to do amplify push I receive the error

Resource is not in the state stackUpdateComplete
Name: OramaStack (AWS::CloudFormation::Stack), 
Event Type: update,
Reason: Parameters: [S3DeploymentBucket, S3DeploymentRootKey] must have values, 
IsCustomResource: false

The operations that I am doing inside the plugin are:

  • create a new bucket that will contain the schema of the entity
  • create a lambda that will manage the research
  • create a lambda that will manage the insert/modify/remove
  • grant all the correct permission to the lambdas
  • deploy with BucketDeployment a json file on the bucket (this json represent the schema for orama)

I think that BucketDeployment triggers this error because is the code that calls new BucketDeployment is removed there is no error and for what I have seen nobody uses that class on an amplify plugin.
So the question is, how do i deploy my schema on my S3 bucket?

@paciops
Copy link
Author

paciops commented Jun 14, 2023

Any suggestion?

@AnilMaktala
Copy link
Member

Hi @paciops, Thank you for bringing this to our attention. Unfortunately, we do not have any documentation specifically addressing this issue. Based on the error you provided, it seems that the S3DeploymentBucket and S3DeploymentRootKey were not passed to the CloudFormation stack. These keys are typically available in the root-cloudformation-stack.json file and passed through the nested stack via the parameters.json file. We recommend adding the appropriate values for these keys in the parameters.json file and testing if it resolves the issue. Please let us know if you have any further questions or concerns.

@paciops
Copy link
Author

paciops commented Jun 21, 2023

Hi @AnilMaktala, unfortunately I cannot specify my S3DeploymentBucket and S3DeploymentRootKey into the parameters.json due to the fact that these two values are generated by the CDK, in fact as you can see here

https://github.com/intales/amplify-category-orama/blob/6a6670a8f320abf8b2ace09ed113f7c25e7604af/src/cdk/create_db_bucket.ts#L15-L22

my BucketDeployment depends on (or at least I think) the previously created Bucket

@balazs-sipos
Copy link

Hi @paciops
I am not sure if this would help you, but I just spent 2 hours debugging what's is going on, because I was getting the same error when I tried to access a CDK output as a lambda env variable.
At first, I followed aws-amplify/amplify-cli#9087 (comment)
Then I saw this comment here: aws-amplify/amplify-cli#12833 (comment)
And I remembered I have seen this tutorial before: https://gist.github.com/dmost714/e914c865e54f9e77a1e49cda3dc78b20

For me, I forgot to do amplify env checkout dev , so my local did not have the output yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensibility question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants