[CT-2059] [Feature] Syntax to restrict selection to the current package

Is this your first time submitting a feature request?

[X] I have read the expectations for open source contributors
[X] I have searched the existing issues, and I could not find an existing issue for this feature
[X] I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature
There are many use cases for not running the models in your packages.

Feeding a dbt ls of the models in the project to an external tool
Only checking the build of the current project in a mesh-like structure
Many others but I won't belabor it unless you disagree :)

Unfortunately there's no easy way that I'm aware of that you can filter to just the models in the project without hardcoding the selects or excludes to various projects. Particularly as the mesh grows, I can see this becoming more of an issue, and a desire to 'just run this project's models' becoming really helpful.
I would love to implement something like:
dbt build --select this.* or perhaps dbt ls --exclude external or dbt run --internal-only/dbt run -i -- i haven't thought of the ideal syntax, but hopefully you get the idea.
Describe alternatives you've considered
You can exclude all the packages by name in YAML selectors, or you can [project_name].* but this isn't very convenient, particularly when working programmatically on top of the CLI, such as with editor extensions that would need to parse the project YAML to get the package name.
Who will this benefit?
This will primarily benefit people using lots of Fivetran packages, a multi-project mesh structure, or some other configuration that involves lots of models contributed by packages that you don't necessarily want to constantly re-run when you're developing.
Are you interested in contributing this feature?
Yes! Very much. Dying to contribute to the CLI in some way.
Anything else?
No response

+1 to this.
A very concrete use case is a vim plugin I am writing where I’d like to provide the user with the ability to quickly jump to any model within their project, however dbt ls shows all models including those in packages.
The JSON keys don’t provide a great way for differentiating between packaged and internal models.

The code for the PackageSelectorMethod is defined here:
https://github.com/dbt-labs/dbt-core/blob/ccb4fa26cd682812f15d2fd50b37a8c422e092f8/core/dbt/graph/selector_methods.py#L295-L300
We don't have access to the full RuntimeConfig here, the closest thing we do have is self.manifest.metadata.project_id, which is the hashed version of the project_name. We could reasonably add the unhashed project_name to the ManifestMetadata, too.

Jumping on the brainstorming bandwagon, here's some ideas for names (some taken from this 😉 ):

this
self
me
root
home
super
mine

$ dbt ls --select package:this
$ dbt ls --select package:self
$ dbt ls --select package:me
$ dbt ls --select package:root
$ dbt ls --select package:home
$ dbt ls --select package:super
$ dbt ls --select package:mine

If needed/desired, we could add some special symbol like $ as a prefix or require special capitalization like This.
$ dbt ls --select package:This
$ dbt ls --select package:$self
$ dbt ls --select package:$Me

(I'm guessing we wouldn't actually use $ 'cause that's special to shells like zsh, bash, etc.)
Alternatively, we could introduce some other selection shorthand that means the same thing as dbt ls --select package:{project_name}.
$ dbt ls --select package:.

That's assuming, of course, that no one names their project/package this, or root, or whatever we come up with

It would be nice if it were somehow impossible to not collide with a project name! We could restrict the possible names to ones that wouldn't be valid project names anyways. Or we could make our choice a reserved keyword and disallow projects from taking on that name (which would be a breaking change).

Something to keep in mind during any implementation:
https://github.com/dbt-labs/dbt-core/issues/6598 / https://github.com/dbt-labs/dbt-core/pull/6599 (not reviewed/merged yet) adds the ability to use Unix-style glob patterns to selectors like:
metric:arr_*
file:stg_salesforce__*.sql
package:internal_pkg_*
source:salesforce.*
tag:*_pii
test_name:singular_test_suite_[1-9]

while still retaining these:
fqn:*
source:*
exposure:*

So we'd want the two features and PRs to be compatible with each other.

at first blush i think this will be the most friendly as it's a concept we already have introduced in dbt templates.
dbt run --select package:this feels quite readable to me!

I won't lie, this did pique my interest:
$ dbt ls --select package:.
$ dbt ls -s .

But I'm not convinced that shorter & cleverer is better here, versus something explicit & easily understandable.

I do wonder if maybe making a package boolean available as part of the JSON output might be a more appropriate solution?
Some type of “internal_package: true” key/value could then be parsed by the user through jq or a programming language as needed. Including the package name could also be very helpful so clients don’t have to also parse the dbt_project.yml file.
In an ideal world, dbt ls —output=json would have two additional keys:

internal_package: bool
package_name: string

This doesn’t prevent also the work described above for selecting internal packages but could be a useful addition for integrations and clients.

(@PedramNavid What time is it where you are?)
There is already the ability to include the package_name in the JSON output of dbt list:
$ dbt ls --output json --output-keys name,resource_type,package_name
{"name": "my_model", "resource_type": "model", "package_name": "test"}
{"name": "my_seed", "resource_type": "seed", "package_name": "test"}

(The CLI syntax of --output-keys is wonky today and should be fixed: #6676)
So if you know your internal/root package's name, it's easy enough to filter on that already. I also see how it would be handy to have that as a (new) boolean flag.

I’m in Singapore right now on an 11 hour layover, only 7pm! Been traveling through many time zones so time is in perpetual flux.
Ah, package name is handy, then either a way to get the package name from dbt might almost be enough to solve this (for me anyway). Maybe just the dbt project name as an output key, then I could easily filter for models where project name==package name?

Bon voyage !
So, today, the options would be:

Pull the name out of dbt_project.yml (doesn't feel great)
We add root_project_name as an output key available from dbt list, thereby enabling an easy filter

Future (!!)
just for fun, while you're laying over
We're working on a Python API for dbt-core that mirrors its CLI functionality (#6356). The syntax I have below is not guaranteed to actually be The Thing a few months from now—lots of design conversation to keep having between now and then—but this does actually work on our feature branch, plus a few small tweaks (https://github.com/dbt-labs/dbt-core/commit/43e7e2bc83d3a9764695e7211337a19f1cf1d3f8).
Does this excite you? Terrify you? Genuinely curious.
# script.py
import json
import pprint
from dbt.cli.main import dbtRunner
from dbt.contracts.graph.manifest import Manifest

manifest: Manifest = None
success: bool = None
list_results: list[str]

# TODO: disable other stdout logging
dbt = dbtRunner()
manifest, success = dbt.invoke(["parse"])
root_project_name = manifest.metadata.project_name

# at this point, you could just loop over manifest.nodes
# but let's imagine you want to use 'dbt list'
list_results, success = dbt.invoke(["list", "--output", "json", "--output-keys", "name,resource_type,package_name"])
results_json = [json.loads(res) for res in list_results]
filtered = [res for res in results_json if res["package_name"] == root_project_name]

pp = pprint.PrettyPrinter()
pp.pprint(filtered)

$ python3 script.py
...
[{'name': 'my_model', 'package_name': 'test', 'resource_type': 'model'},
 {'name': 'my_seed', 'package_name': 'test', 'resource_type': 'seed'}]

i have a feeling our boy P-Money is using lua for his nvim plug so a python api might not do the trick
@PedramNavid  for present day constraints, might i suggest using yq instead (might already be on your radar but it was new to me last week) -- makes parsing YAML very jq like and it handles a bunch of formats!

I won't lie, this did pique my interest:
$ dbt ls --select package:.
$ dbt ls -s .

But I'm not convinced that shorter & cleverer is better here, versus something explicit & easily understandable.

true! that would be an invalid project name right? or we could safely make it one? i do feel icky about the possibility of some company called "This Cosmetics" making a project called "this", and i also don't like the idea of outlawing 'this' as a project name.

I love the Python API, but Winnie has it right, my integration is lua so I’m dependent on the command line. I’ve also seen integrations built using JS/TypeScript so being able to access more detailed information via stdout is a bit more flexible.
Both jq/yq are great solutions but hard for me to use for a project i want to distribute widely. Fortunately vim comes with a json parser and I can use grep/sed to extract the project name from the dbt_project.yml so I’m not blocked here at all!

mmm yea right right, i ran into this problem with some codegen stuff i was building (re the portability of jq/yq).
i don't like the boolean as it feels a lot for not much info, but i wouldn't hate the idea of a package_type key, with values like root or this, external, internal (signaling a company's internal mesh packages) that provides a little more flexibility and information.
i do want the CLI to have this functionality regardless of the specific tooling use case.

WIP branch https://github.com/dbt-labs/dbt-core/tree/winnie/this-package-selector
trying to figure out how to get the newly added self.manifest.metadata.project_name to actually populate (currently it's returning None) -- i don't actually understand that area of the codebase yet so will have to circle back.
appreciate if anybody has any ideas or context on that though! once that's working i think the rest of it is a pleasant cruise.

@jtcohen6 i think i'm hitting a wall, from what i can understand in my very, very limited understanding -- i think project_name has been added to the ManifestMetadata, the property is now being returned okay, but it's always None. any thoughts on where i'm missing giving that its value?

@gwenwindflower I was running into that too! (While testing the commit I linked above.) Confusing, but—I figured out it was a thing with partial parsing (the existing manifest doesn't have the project_name in its metadata). Try deleting the target/ directory, or disabling partial parsing, and see if that fixes it in your local testing.

🙌🏻 💥 brilliant!
we're cooking!
i'll try to write some tests for this this weekend and then do a proper PR.

Hi @gwenwindflower & @jtcohen6, this feature request seems to be a bit stale, but I have raised recently a similar issue (#8954) and @dbeatty10 redirected me here, so I wanted to bump it with a few comments.
As I can see, the core discussion here is about the proper syntax for selecting nodes from the current package. That's definitely a step forward, but I wanted to put on a table a bit different approach:

I would expect dbt to only select a model from the current project (namespace) by default.

If you want to match a model with the same name from an installed package - you should specify it explicitly with -s "another_package.some_model".
If you want to match all models with given name from all packages - you should specify it explicitly as -s "*.some_model".

I see two main benefits of such approach:

you don't have to remember about specifying -s package:. each time you want to run a model / a subset of models from your current package and be sure no models from installed packages are selected - it would be given as a default behaviour then
it's less error-prone when working with multiple models with the same name - since namespaces were introduced, the current behaviour to match nodes from all installed packages can very easily lead to unexpected situations like the one described in #8954

This way you can run simple commands like dbt compile or dbt build -s some_model and don't worry about any side effects - the default context is always limited to your current project.
That's also related to another point raised in the above issue:

I believe it shouldn't be possible to select private and protected models from a package with restrict-access: True at all.

As @dbeatty10 replied there - currently model access modifies are only applied for ref(), and not for selection. But you can imagine to revisit that approach in the future (personally I find it quite reasonable) and with the above approach - it would be much easier to introduce such change.

If that proposal doesn't resonate with you, I have two more ideas:

Enable such behaviour with project config. In this case we don't change the default behaviour of dbt, but we allow to configure it in dbt_projects.yml and ensure consistent outcomes when working on given package.

Allow to combine a YAML selector with flags. Currently it's not possible:

If I run a command that defines its own selection criteria (via --select, --exclude, or --selector), dbt will ignore the default selector and use the flag criteria instead. It will not try to combine the two.

but if we can set a selector as default and mark it as non-overwritable - then you would be able to define -s package:. as the default one and ensure it's still applied even if additional flags are provided, so e.g. dbt build -s some_model would be resolved to dbt build -s package:. -s some_model.

@jaklan Thanks for offering these ideas! Since they are are extending the scope of the original issue here, would you mind opening up new issue(s) here?
Although it's related to this one, the scope is different, so we'd like to treat it as a separate proposal.

If anyone wants to implement the narrowly version of this issue as-is, winnie had a WIP branch here that you could take a peek at and create your own branch from.
Most of the diff is reformatting import statements. From a quick peek, these are the sections with changed logic:

get_metadata
project_name
PackageSelectorMethod

@barton996 Thank you for opening the PR! @aranke and I started reviewing today, and we wanted to revisit the question of whether this syntax should be:
dbt ls -s package:.
dbt ls -s package:this
# or something else

After talking it through, we like dbt ls -s package:this the best. Two reasons:

It's not a Unix glob pattern (as are * or .), so we avoid confusion there. It's already more of a dbt convention: {{ this }} to mean "current" model, as package:this would means current/root project.
Thinking through the fact that you can run dbt from a subfolder of a project, and dbt will recurse up to find the nearest parent project directory. It is intended behavior that this always works the same, as if you were running it from the project root, but the use of . (which often means "current directory") might seem like it should yield different behavior depending on the working directory where dbt is running.

@barton996 I will leave a comment on the PR suggesting this syntax change, if it makes sense to you!

@jtcohen6 quite an edge-case, but... in that scenario you would need to restrict this as a potential package name.
I would personally vote for . as that's a similar syntax to pip install . which makes it intuitive, but it doesn't matter so much - I rather wonder what you think about the points raised in that comment: https://github.com/dbt-labs/dbt-core/issues/6891#issuecomment-1790314996

@jaklan Definitely considered (in comments above) - I think the added clarity outweighs the edge case (risk of collision with installed package named this).
For the ideas further up -

I don't think we're going to change the default selection behavior (only root project versus all enabled resources)
We should support package:this within yaml selectors, including a "default" selector
Re: combined use of --selector + --select/--exclude: There's an issue for this, with a lot of good discussion, and a PR that I'm long overdue for responding to :)


Added '--show-errors' option

Added '--show-errors' option for printing errors to command line.

What is the difference with --verbose?

@draftcode --verbose is too verbose, it gives tons of unnecessary information. It works well for debugging, but it's really not suitable to regular usage. Meanwhile --show-errors shows nice list of only failed specs and short summary.

I understand your intention.

@draftcode please check again.

@draftcode @sorah should be good now ;)

@draftcode @sorah please check.

@draftcode @sorah I squashed commits to single commit, so it's ready to be merged if you don't have any more comments.

Sorry for the delay. I'm moving across the countries and very busy these days...


dbt 20 compatibility updates

Are you a current Fivetran customer?

Fivetran created PR
What change(s) does this PR introduce?

This PR introduces dbt 20 compatibility
Does this PR introduce a breaking change?

[X] Yes (please provide breaking change details below.)
[ ] No  (please provide explanation how the change is non breaking below.)

This PR contains breaking changes in the form of dbt 20 package dependencies
Is this PR in response to a previously created Issue

[ ] Yes, Issue [link issue number here]
[X] No

How did you test the PR changes?

[X] CircleCi
[ ] Other (please provide additional testing details below)

Select which warehouse(s) were used to test the PR

[X] BigQuery
[X] Redshift
[X] Snowflake
[X] Postgres
[X] Databricks
[ ] Other (provide details below)

Provide an emoji that best describes your current mood

🆙
Feedback
We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your feedback on our existing dbt packages or what you'd like to see next.

You guys merging this soon? Eagerly waiting :)

You guys merging this soon? Eagerly waiting :)

Hey @alanzfu we are eagerly awaiting as well 😄 ! We actually recently made this package compatibile with Spark and there is a dbt-spark issue that was recently identified and merged which we are waiting to be released before we merge this PR and cut the new release.
We are keeping out eyes on the next release of dbt-spark and will let you know once we are able to move forward as we do not want to cut a release of this package with parts that could fail for some users.

fyi closing this PR and batching dbt 20 changes into https://github.com/fivetran/dbt_jira_source/pull/19 which will be merged shortly 😃


How to disable gui applications option for a particular distro on your pc if you have more than one

hello I have installed two linux distros - ubuntu and kali linux.
and i want wslg to only enable on ubuntu not on kali linux.
for making a .wslconfig file disable the support for both but I want it enable for ubunut.

Thanks for the feedback. That is not currently possible, but has been suggested and something we'll be looking into enabling (see #73)

Unless WSLg is giving you serious problems (like the distro won't execute), you can as a workaround change the value of the DISPLAY environment variable at for example .bashrc.
Regards,


striptags not removing inner tags.

Lets say i want to allow P tag but not B tag but if i put B tag inside P then it's not removing a tag.
Content:
ashish asdasd

Code: striptags(pastedText,
)
OutPut:
ashish asdasd

Is there any way where i can remove inner tag as well?

Hello @DeveloperAdd007, what version are you using? I am unable to replicate the behavior you're seeing in both 3.2.0 and the 4.0.0-alpha2:

3.2.0: https://runkit.com/embed/v52yqeck7cs3
4.0.0-alpha2: https://runkit.com/embed/bdw28eiolg0c

Both result in:

ashish asdasd

...which is expected as far as I'm aware. Keep in mind that if you want more advanced tag stripping functionality, you should be using an HTML parser, not this library.


Crash after selecting game mode in Jimmy Conners Tennis

Well, not really crash, pause feature works. :)

0.4.6 game starts.


A question: What is appTemp?

I have looked around, I checked the code, checked past issues, but I can't work out what appTemp actually is?

Maybe it is too late for reply but take a look here:
https://groups.google.com/g/weewx-user/c/FOcDKr8FH2E
https://en.wikipedia.org/wiki/Apparent_temperature
I cite from Wikipedia: "Apparent temperature, also known as feels like, is the temperature (...) by the combined effects of air temperature, relative humidity and wind speed."


Not working for me

I have a several batch files to start/stop services, each takes a start or stop parameter
Entering as
C:\UsefulCommands\scripts\ServerScripts\service_LCLSRVCAISQL1 start
the parameter is not coming through but works as expected when entered into a CMD prompt directly. Most probably an issue with me but any ideas?

Unfortunately I no longer have a working StreamDeck device and can't test/repro this for you. The plugin works by starting a new instance of cmd.exe and essentially pasting in the Command line setting you've entered in the UI, so it should work the same. Are you definitely starting from a CMD prompt when testing and not PowerShell? You might also try putting your parameter in single- or double-quotes just to mix things up a bit.

For me, this worked, although it required full-path of the binary.


upgrade electron to latest version

The Issue
https://github.com/electron/electron/releases
There was some discussion about waiting for 5 to get out of beta, or go with 5. Looks like a new update for 5 was just released 4 days ago.
Suggested Solutions
Tell us your suggested solutions if you have any.
System Configuration

LBRY Daemon version:
LBRY App version:
LBRY Installation ID:
Operating system:

Anything Else

Screenshots

Upgrading to 4 in https://github.com/lbryio/lbry-desktop/pull/2276/files
4 was only recently working after some of our dependencies made some updates to work properly with it. Haven't tested 5 though so that might work. I don't want to add it until it's out of beta though.

On master...


Using a separate autodoc page for each module.

I was working on #257 and reading http://sphinx-doc.org/man/sphinx-apidoc.html and noticed that --separate is a useful flag (to keep the docs pages relatively small and digestible).

What do we know about the failing Travis build?

It looks like it's a consistent failure.
Probably related to the fact that cryptography==1.0 was released yesterday.


Reuse createAnyOneOf while creating a property

Description
createAnyOneOfProperty has an incomplete implementation and doesn't display all possible types at the moment, but only 'object' type. Reusing createAnyOneOf helps with making it display all possible mods.
Motivation and Context
A bug in createAnyOneOfProperty prevents from seeing all mods and shows MOD1, MOD2, etc for primitive types and arrays.
How Has This Been Tested?

See the snapshot of the before and after:
https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/commit/55a26858333f83b109868c931d63a55ec58b50d7
Screenshots (if appropriate)

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist

[ ] I have updated the documentation accordingly.
[ ] I have read the CONTRIBUTING document.
[x] I have added tests to cover my changes if appropriate.
[ ] All new and existing tests passed.

@Ugzuzg, thanks for opening the PR. Looks like there was a linter error that stopped the build from happening.

@sserrata, reconfigured eslint to allow importing dev dependencies in test files. Hope, that's ok.

Hi @Ugzuzg, I addressed the remaining linter error. The deploy preview looks good - how are things looking for you?

Looks good.


add recursive-open-struct to Gemfile

It's used in 2 container specs now, but only works because it's a dependency of kubeclient and openshift_client => should be explicitly referenced :).
@zeari FYI :)

@himdel Ah, I wanted to take care of this when #5938 gets merged.
This way actually makes a lot of sense :X

Yeah I figured you would either get to it or have forgotten, so I wanted to be sure as long as I still remember :)


Is there a way to specifiy thedynamodb tablename when creating a api resource using amplify?

Note: If your question is regarding the AWS Amplify Console service, please log it in the
official AWS Amplify Console forum

** Which Category is your question related to? **
amplify
** What AWS Services are you utilizing? **
app sync
** Provide additional details e.g. code snippets **

Currently whenever I try to create resources using amplify it concatenates a long randon string? How can this be prevented?

You can specify the resource names that are prompted during the execution of the add command. Others are auto generated for you and you are not advice change them because they may be referenced by other resources. The CLI uses long random string to prevent accidental name clash.

In my understanding the resources that are prompted during add command execution are for Project name and env. This has little to do with generated tablenames so it does not solve my problem. Generated tablenames are created from the typenames in graphql schema. We have a usecase where we are storing the same table for storing multiple types. How can achieve that using amplify?

@djkingh01 Currently the @model directive expects to contain a single data type, however, we are looking at generlizing this to allow overloaded indexes & multiple types per table but there is not set date on when this will be available. This being said, you are able to write your own resolvers that target your own data sources within the CLI using custom stacks.
The process to do this would be to

Create a DynamoDB Table resource within a custom CloudFormation stack.
Create a scoped down IAM role that has access to your table and it's indexes as well as a trust policy for appsync.amazon.com.
Create an AppSync Datasource resource that points to your IAM role and DynamoDB table.
Add resolvers that target your Datasource. These resolvers can return whatever type of data is stored in your DynamoDB table.

I am trying to follow your directions. I created a new AccountData.json file in the api/[apiname]/stacks directory. Get the following errors.
CREATE_FAILED      AccountDatajson     AWS::CloudFormation::Stack Sat Mar 09 2019 22:59:34 GMT-0500 (Eastern Standard Time) Parameters
: [GetAttGraphQLAPIApiId] must have values
CREATE_FAILED      CustomResourcesjson AWS::CloudFormation::Stack Sat Mar 09 2019 22:59:35 GMT-0500 (Eastern Standard Time) Resource c
reation cancelled
a. I understand that I am supposed to enter some values in maybe parameters.json. Can you point to the where the documentation exists for the same?
AccountData.json
`{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An auto-generated nested stack.",
"Metadata": {},
"Parameters": {
"AppSyncApiName": {
"Type": "String",
"Description": "The name of the AppSync API",
"Default": "AppSyncSimpleTransform"
},
"APIKeyExpirationEpoch": {
"Type": "Number",
"Description": "The epoch time in seconds when the API Key should expire. Setting this to 0 will default to 1 week from the deployment date. Setting this to -1 will not create an API Key.",
"Default": 0
},
"DynamoDBModelTableReadIOPS": {
"Type": "Number",
"Description": "The number of read IOPS the table should support.",
"Default": 5
},
"DynamoDBModelTableWriteIOPS": {
"Type": "Number",
"Description": "The number of write IOPS the table should support.",
"Default": 5
},
"DynamoDBBillingMode": {
"Type": "String",
"Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes.",
"Default": "PAY_PER_REQUEST",
"AllowedValues": [
"PAY_PER_REQUEST",
"PROVISIONED"
]
},
"AuthCognitoUserPoolId": {
"Type": "String",
"Description": "The id of an existing User Pool to connect. If this is changed, a user pool will not be created for you.",
"Default": "NONE"
},
"AuthCognitoUserPoolName": {
"Type": "String",
"Description": "The name of the user pool.",
"Default": "AppSyncUserPool"
},
"AuthCognitoUserPoolMobileClientName": {
"Type": "String",
"Description": "The name of the native user pool client.",
"Default": "CognitoNativeClient"
},
"AuthCognitoUserPoolJSClientName": {
"Type": "String",
"Description": "The name of the web user pool client.",
"Default": "CognitoJSClient"
},
"AuthCognitoUserPoolRefreshTokenValidity": {
"Type": "Number",
"Description": "The time limit, in days, after which the refresh token is no longer valid.",
"Default": 30
},
"env": {
"Type": "String",
"Description": "The environment name. e.g. Dev, Test, or Production",
"Default": "NONE"
},
"S3DeploymentBucket": {
"Type": "String",
"Description": "The S3 bucket containing all deployment assets for the project."
},
"S3DeploymentRootKey": {
"Type": "String",
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root of the deployment directory."
},
"AppSyncApiId": {
"Type": "String",
"Description": "The id of the AppSync API associated with this project."
},
"GetAttGraphQLAPIApiId": {
"Type": "String",
"Description": "Auto-generated parameter that forwards Fn.GetAtt(GraphQLAPI, ApiId) through to nested stacks."
}
},
"Resources": {
"AccountDataTable": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"TableName": {
"Fn::If": [
"HasEnvironmentParameter",
{
"Fn::Join": [
"-",
[
"AccountData",
{
"Ref": "GetAttGraphQLAPIApiId"
},
{
"Ref": "env"
}
]
]
},
{
"Fn::Join": [
"-",
[
"AccountData",
{
"Ref": "GetAttGraphQLAPIApiId"
}
]
]
}
]
},
"KeySchema": [
{
"AttributeName": "pk",
"KeyType": "HASH"
},
{
"AttributeName": "fk",
"KeyType": "RANGE"
}
            ],
            "AttributeDefinitions": [
                {
                    "AttributeName": "pk",
                    "AttributeType": "S"
                },
                {
                    "AttributeName": "fk",
                    "AttributeType": "S"
                }

            ],
            "StreamSpecification": {
                "StreamViewType": "NEW_AND_OLD_IMAGES"
            },
            "BillingMode": {
                "Fn::If": [
                    "ShouldUsePayPerRequestBilling",
                    "PAY_PER_REQUEST",
                    {
                        "Ref": "AWS::NoValue"
                    }
                ]
            },
            "ProvisionedThroughput": {
                "Fn::If": [
                    "ShouldUsePayPerRequestBilling",
                    {
                        "Ref": "AWS::NoValue"
                    },
                    {
                        "ReadCapacityUnits": {
                            "Ref": "DynamoDBModelTableReadIOPS"
                        },
                        "WriteCapacityUnits": {
                            "Ref": "DynamoDBModelTableWriteIOPS"
                        }
                    }
                ]
            },
            "SSESpecification": {
                "SSEEnabled": true
            }
        }
    },
    "AccountDataIAMRole": {
        "Type": "AWS::IAM::Role",
        "Properties": {
            "RoleName": {
                "Fn::If": [
                    "HasEnvironmentParameter",
                    {
                        "Fn::Join": [
                            "-",
                            [
                                "AccountData",
                                "role",
                                {
                                    "Ref": "GetAttGraphQLAPIApiId"
                                },
                                {
                                    "Ref": "env"
                                }
                            ]
                        ]
                    },
                    {
                        "Fn::Join": [
                            "-",
                            [
                                "AccountData",
                                "role",
                                {
                                    "Ref": "GetAttGraphQLAPIApiId"
                                }
                            ]
                        ]
                    }
                ]
            },
            "AssumeRolePolicyDocument": {
                "Version": "2012-10-17",
                "Statement": [
                    {
                        "Effect": "Allow",
                        "Principal": {
                            "Service": "appsync.amazonaws.com"
                        },
                        "Action": "sts:AssumeRole"
                    }
                ]
            },
            "Policies": [
                {
                    "PolicyName": "DynamoDBAccess",
                    "PolicyDocument": {
                        "Version": "2012-10-17",
                        "Statement": [
                            {
                                "Effect": "Allow",
                                "Action": [
                                    "dynamodb:BatchGetItem",
                                    "dynamodb:BatchWriteItem",
                                    "dynamodb:PutItem",
                                    "dynamodb:DeleteItem",
                                    "dynamodb:GetItem",
                                    "dynamodb:Scan",
                                    "dynamodb:Query",
                                    "dynamodb:UpdateItem"
                                ],
                                "Resource": [
                                    {
                                        "Fn::Sub": [
                                            "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}",
                                            {
                                                "tablename": {
                                                    "Fn::If": [
                                                        "HasEnvironmentParameter",
                                                        {
                                                            "Fn::Join": [
                                                                "-",
                                                                [
                                                                    "AccountData",
                                                                    {
                                                                        "Ref": "GetAttGraphQLAPIApiId"
                                                                    },
                                                                    {
                                                                        "Ref": "env"
                                                                    }
                                                                ]
                                                            ]
                                                        },
                                                        {
                                                            "Fn::Join": [
                                                                "-",
                                                                [
                                                                    "AccountData",
                                                                    {
                                                                        "Ref": "GetAttGraphQLAPIApiId"
                                                                    }
                                                                ]
                                                            ]
                                                        }
                                                    ]
                                                }
                                            }
                                        ]
                                    },
                                    {
                                        "Fn::Sub": [
                                            "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}/*",
                                            {
                                                "tablename": {
                                                    "Fn::If": [
                                                        "HasEnvironmentParameter",
                                                        {
                                                            "Fn::Join": [
                                                                "-",
                                                                [
                                                                    "AccountData",
                                                                    {
                                                                        "Ref": "GetAttGraphQLAPIApiId"
                                                                    },
                                                                    {
                                                                        "Ref": "env"
                                                                    }
                                                                ]
                                                            ]
                                                        },
                                                        {
                                                            "Fn::Join": [
                                                                "-",
                                                                [
                                                                    "AccountData",
                                                                    {
                                                                        "Ref": "GetAttGraphQLAPIApiId"
                                                                    }
                                                                ]
                                                            ]
                                                        }
                                                    ]
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                }
            ]
        }
    },
    "AccountDataDataSource": {
        "Type": "AWS::AppSync::DataSource",
        "Properties": {
            "ApiId": {
                "Ref": "GetAttGraphQLAPIApiId"
            },
            "Name": "AccountDataTable",
            "Type": "AMAZON_DYNAMODB",
            "ServiceRoleArn": {
                "Fn::GetAtt": [
                    "AccountDataIAMRole",
                    "Arn"
                ]
            },
            "DynamoDBConfig": {
                "AwsRegion": {
                    "Ref": "AWS::Region"
                },
                "TableName": {
                    "Fn::If": [
                        "HasEnvironmentParameter",
                        {
                            "Fn::Join": [
                                "-",
                                [
                                    "AccountData",
                                    {
                                        "Ref": "GetAttGraphQLAPIApiId"
                                    },
                                    {
                                        "Ref": "env"
                                    }
                                ]
                            ]
                        },
                        {
                            "Fn::Join": [
                                "-",
                                [
                                    "AccountData",
                                    {
                                        "Ref": "GetAttGraphQLAPIApiId"
                                    }
                                ]
                            ]
                        }
                    ]
                }
            }
        },
        "DependsOn": [
            "AccountDataIAMRole"
        ]
    },
    "GetAccountDataResolver": {
        "Type": "AWS::AppSync::Resolver",
        "Properties": {
            "ApiId": {
                "Ref": "GetAttGraphQLAPIApiId"
            },
            "DataSourceName": {
                "Fn::GetAtt": [
                    "AccountDataDataSource",
                    "Name"
                ]
            },
            "FieldName": "getAccountData",
            "TypeName": "Query",
            "RequestMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Query",
                                    "getAccountData",
                                    "req",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            },
            "ResponseMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Query",
                                    "getAccountData",
                                    "res",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            }
        }
    },
    "ListAccountDataResolver": {
        "Type": "AWS::AppSync::Resolver",
        "Properties": {
            "ApiId": {
                "Ref": "GetAttGraphQLAPIApiId"
            },
            "DataSourceName": {
                "Fn::GetAtt": [
                    "AccountDataDataSource",
                    "Name"
                ]
            },
            "FieldName": "listAccountDatas",
            "TypeName": "Query",
            "RequestMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Query",
                                    "listAccountDatas",
                                    "req",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            },
            "ResponseMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Query",
                                    "listAccountDatas",
                                    "res",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            }
        }
    },
    "CreateAccountDataResolver": {
        "Type": "AWS::AppSync::Resolver",
        "Properties": {
            "ApiId": {
                "Ref": "GetAttGraphQLAPIApiId"
            },
            "DataSourceName": {
                "Fn::GetAtt": [
                    "AccountDataDataSource",
                    "Name"
                ]
            },
            "FieldName": "createAccountData",
            "TypeName": "Mutation",
            "RequestMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Mutation",
                                    "createAccountData",
                                    "req",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            },
            "ResponseMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Mutation",
                                    "createAccountData",
                                    "res",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            }
        }
    },
    "UpdateAccountDataResolver": {
        "Type": "AWS::AppSync::Resolver",
        "Properties": {
            "ApiId": {
                "Ref": "GetAttGraphQLAPIApiId"
            },
            "DataSourceName": {
                "Fn::GetAtt": [
                    "AccountDataDataSource",
                    "Name"
                ]
            },
            "FieldName": "updateAccountData",
            "TypeName": "Mutation",
            "RequestMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Mutation",
                                    "updateAccountData",
                                    "req",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            },
            "ResponseMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Mutation",
                                    "updateAccountData",
                                    "res",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            }
        }
    },
    "DeleteAccountDataResolver": {
        "Type": "AWS::AppSync::Resolver",
        "Properties": {
            "ApiId": {
                "Ref": "GetAttGraphQLAPIApiId"
            },
            "DataSourceName": {
                "Fn::GetAtt": [
                    "AccountDataDataSource",
                    "Name"
                ]
            },
            "FieldName": "deleteAccountData",
            "TypeName": "Mutation",
            "RequestMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Mutation",
                                    "deleteAccountData",
                                    "req",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            },
            "ResponseMappingTemplateS3Location": {
                "Fn::Sub": [
                    "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                    {
                        "S3DeploymentBucket": {
                            "Ref": "S3DeploymentBucket"
                        },
                        "S3DeploymentRootKey": {
                            "Ref": "S3DeploymentRootKey"
                        },
                        "ResolverFileName": {
                            "Fn::Join": [
                                ".",
                                [
                                    "Mutation",
                                    "deleteAccountData",
                                    "res",
                                    "vtl"
                                ]
                            ]
                        }
                    }
                ]
            }
        }
    }
},
"Outputs": {},
"Conditions": {
    "APIKeyExpirationEpochIsNotNegOne": {
        "Fn::Not": [
            {
                "Fn::Equals": [
                    {
                        "Ref": "APIKeyExpirationEpoch"
                    },
                    -1
                ]
            }
        ]
    },
    "APIKeyExpirationEpochIsPositive": {
        "Fn::And": [
            {
                "Fn::Not": [
                    {
                        "Fn::Equals": [
                            {
                                "Ref": "APIKeyExpirationEpoch"
                            },
                            -1
                        ]
                    }
                ]
            },
            {
                "Fn::Not": [
                    {
                        "Fn::Equals": [
                            {
                                "Ref": "APIKeyExpirationEpoch"
                            },
                            0
                        ]
                    }
                ]
            }
        ]
    },
    "ShouldUsePayPerRequestBilling": {
        "Fn::Equals": [
            {
                "Ref": "DynamoDBBillingMode"
            },
            "PAY_PER_REQUEST"
        ]
    },
    "AuthShouldCreateUserPool": {
        "Fn::Equals": [
            {
                "Ref": "AuthCognitoUserPoolId"
            },
            "NONE"
        ]
    },
    "HasEnvironmentParameter": {
        "Fn::Not": [
            {
                "Fn::Equals": [
                    {
                        "Ref": "env"
                    },
                    "NONE"
                ]
            }
        ]
    }
}

}`

I am trying to follow your directions and create a new custom type AccountData where I am going to store all my data.

Added the type to schema.graphql
type AccountData @model { pk: ID! fk: String! description: String }

Added a new custom type AccountData.json in the stacks directory outside the build.
`{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An auto-generated nested stack.",
"Metadata": {},
"Parameters": {
"AppSyncApiName": {
"Type": "String",
"Description": "The name of the AppSync API",
"Default": "AppSyncSimpleTransform"
},
"APIKeyExpirationEpoch": {
"Type": "Number",
"Description": "The epoch time in seconds when the API Key should expire. Setting this to 0 will default to 1 week from the deployment date. Setting this to -1 will not create an API Key.",
"Default": 0
},
"DynamoDBModelTableReadIOPS": {
"Type": "Number",
"Description": "The number of read IOPS the table should support.",
"Default": 5
},
"DynamoDBModelTableWriteIOPS": {
"Type": "Number",
"Description": "The number of write IOPS the table should support.",
"Default": 5
},
"DynamoDBBillingMode": {
"Type": "String",
"Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes.",
"Default": "PAY_PER_REQUEST",
"AllowedValues": [
"PAY_PER_REQUEST",
"PROVISIONED"
]
},
"AuthCognitoUserPoolId": {
"Type": "String",
"Description": "The id of an existing User Pool to connect. If this is changed, a user pool will not be created for you.",
"Default": "NONE"
},
"AuthCognitoUserPoolName": {
"Type": "String",
"Description": "The name of the user pool.",
"Default": "AppSyncUserPool"
},
"AuthCognitoUserPoolMobileClientName": {
"Type": "String",
"Description": "The name of the native user pool client.",
"Default": "CognitoNativeClient"
},
"AuthCognitoUserPoolJSClientName": {
"Type": "String",
"Description": "The name of the web user pool client.",
"Default": "CognitoJSClient"
},
"AuthCognitoUserPoolRefreshTokenValidity": {
"Type": "Number",
"Description": "The time limit, in days, after which the refresh token is no longer valid.",
"Default": 30
},
"env": {
"Type": "String",
"Description": "The environment name. e.g. Dev, Test, or Production",
"Default": "NONE"
},
"S3DeploymentBucket": {
"Type": "String",
"Description": "The S3 bucket containing all deployment assets for the project."
},
"S3DeploymentRootKey": {
"Type": "String",
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root of the deployment directory."
},
"AppSyncApiId": {
"Type": "String",
"Description": "The id of the AppSync API associated with this project."
},
"GetAttGraphQLAPIApiId": {
"Type": "String",
"Description": "Auto-generated parameter that forwards Fn.GetAtt(GraphQLAPI, ApiId) through to nested stacks."
}
},
"Resources": {
"AccountDataTable": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"TableName": {
"Fn::If": [
"HasEnvironmentParameter",
{
"Fn::Join": [
"-",
[
"AccountData",
{
"Ref": "GetAttGraphQLAPIApiId"
},
{
"Ref": "env"
}
]
]
},
{
"Fn::Join": [
"-",
[
"AccountData",
{
"Ref": "GetAttGraphQLAPIApiId"
}
]
]
}
]
},
"KeySchema": [
{
"AttributeName": "pk",
"KeyType": "HASH"
},
{
"AttributeName": "fk",
"KeyType": "RANGE"
}
         ],
         "AttributeDefinitions": [
             {
                 "AttributeName": "pk",
                 "AttributeType": "S"
             },
             {
                 "AttributeName": "fk",
                 "AttributeType": "S"
             }

         ],
         "StreamSpecification": {
             "StreamViewType": "NEW_AND_OLD_IMAGES"
         },
         "BillingMode": {
             "Fn::If": [
                 "ShouldUsePayPerRequestBilling",
                 "PAY_PER_REQUEST",
                 {
                     "Ref": "AWS::NoValue"
                 }
             ]
         },
         "ProvisionedThroughput": {
             "Fn::If": [
                 "ShouldUsePayPerRequestBilling",
                 {
                     "Ref": "AWS::NoValue"
                 },
                 {
                     "ReadCapacityUnits": {
                         "Ref": "DynamoDBModelTableReadIOPS"
                     },
                     "WriteCapacityUnits": {
                         "Ref": "DynamoDBModelTableWriteIOPS"
                     }
                 }
             ]
         },
         "SSESpecification": {
             "SSEEnabled": true
         }
     }
 },
 "AccountDataIAMRole": {
     "Type": "AWS::IAM::Role",
     "Properties": {
         "RoleName": {
             "Fn::If": [
                 "HasEnvironmentParameter",
                 {
                     "Fn::Join": [
                         "-",
                         [
                             "AccountData",
                             "role",
                             {
                                 "Ref": "GetAttGraphQLAPIApiId"
                             },
                             {
                                 "Ref": "env"
                             }
                         ]
                     ]
                 },
                 {
                     "Fn::Join": [
                         "-",
                         [
                             "AccountData",
                             "role",
                             {
                                 "Ref": "GetAttGraphQLAPIApiId"
                             }
                         ]
                     ]
                 }
             ]
         },
         "AssumeRolePolicyDocument": {
             "Version": "2012-10-17",
             "Statement": [
                 {
                     "Effect": "Allow",
                     "Principal": {
                         "Service": "appsync.amazonaws.com"
                     },
                     "Action": "sts:AssumeRole"
                 }
             ]
         },
         "Policies": [
             {
                 "PolicyName": "DynamoDBAccess",
                 "PolicyDocument": {
                     "Version": "2012-10-17",
                     "Statement": [
                         {
                             "Effect": "Allow",
                             "Action": [
                                 "dynamodb:BatchGetItem",
                                 "dynamodb:BatchWriteItem",
                                 "dynamodb:PutItem",
                                 "dynamodb:DeleteItem",
                                 "dynamodb:GetItem",
                                 "dynamodb:Scan",
                                 "dynamodb:Query",
                                 "dynamodb:UpdateItem"
                             ],
                             "Resource": [
                                 {
                                     "Fn::Sub": [
                                         "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}",
                                         {
                                             "tablename": {
                                                 "Fn::If": [
                                                     "HasEnvironmentParameter",
                                                     {
                                                         "Fn::Join": [
                                                             "-",
                                                             [
                                                                 "AccountData",
                                                                 {
                                                                     "Ref": "GetAttGraphQLAPIApiId"
                                                                 },
                                                                 {
                                                                     "Ref": "env"
                                                                 }
                                                             ]
                                                         ]
                                                     },
                                                     {
                                                         "Fn::Join": [
                                                             "-",
                                                             [
                                                                 "AccountData",
                                                                 {
                                                                     "Ref": "GetAttGraphQLAPIApiId"
                                                                 }
                                                             ]
                                                         ]
                                                     }
                                                 ]
                                             }
                                         }
                                     ]
                                 },
                                 {
                                     "Fn::Sub": [
                                         "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}/*",
                                         {
                                             "tablename": {
                                                 "Fn::If": [
                                                     "HasEnvironmentParameter",
                                                     {
                                                         "Fn::Join": [
                                                             "-",
                                                             [
                                                                 "AccountData",
                                                                 {
                                                                     "Ref": "GetAttGraphQLAPIApiId"
                                                                 },
                                                                 {
                                                                     "Ref": "env"
                                                                 }
                                                             ]
                                                         ]
                                                     },
                                                     {
                                                         "Fn::Join": [
                                                             "-",
                                                             [
                                                                 "AccountData",
                                                                 {
                                                                     "Ref": "GetAttGraphQLAPIApiId"
                                                                 }
                                                             ]
                                                         ]
                                                     }
                                                 ]
                                             }
                                         }
                                     ]
                                 }
                             ]
                         }
                     ]
                 }
             }
         ]
     }
 },
 "AccountDataDataSource": {
     "Type": "AWS::AppSync::DataSource",
     "Properties": {
         "ApiId": {
             "Ref": "GetAttGraphQLAPIApiId"
         },
         "Name": "AccountDataTable",
         "Type": "AMAZON_DYNAMODB",
         "ServiceRoleArn": {
             "Fn::GetAtt": [
                 "AccountDataIAMRole",
                 "Arn"
             ]
         },
         "DynamoDBConfig": {
             "AwsRegion": {
                 "Ref": "AWS::Region"
             },
             "TableName": {
                 "Fn::If": [
                     "HasEnvironmentParameter",
                     {
                         "Fn::Join": [
                             "-",
                             [
                                 "AccountData",
                                 {
                                     "Ref": "GetAttGraphQLAPIApiId"
                                 },
                                 {
                                     "Ref": "env"
                                 }
                             ]
                         ]
                     },
                     {
                         "Fn::Join": [
                             "-",
                             [
                                 "AccountData",
                                 {
                                     "Ref": "GetAttGraphQLAPIApiId"
                                 }
                             ]
                         ]
                     }
                 ]
             }
         }
     },
     "DependsOn": [
         "AccountDataIAMRole"
     ]
 },
 "GetAccountDataResolver": {
     "Type": "AWS::AppSync::Resolver",
     "Properties": {
         "ApiId": {
             "Ref": "GetAttGraphQLAPIApiId"
         },
         "DataSourceName": {
             "Fn::GetAtt": [
                 "AccountDataDataSource",
                 "Name"
             ]
         },
         "FieldName": "getAccountData",
         "TypeName": "Query",
         "RequestMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Query",
                                 "getAccountData",
                                 "req",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         },
         "ResponseMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Query",
                                 "getAccountData",
                                 "res",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         }
     }
 },
 "ListAccountDataResolver": {
     "Type": "AWS::AppSync::Resolver",
     "Properties": {
         "ApiId": {
             "Ref": "GetAttGraphQLAPIApiId"
         },
         "DataSourceName": {
             "Fn::GetAtt": [
                 "AccountDataDataSource",
                 "Name"
             ]
         },
         "FieldName": "listAccountDatas",
         "TypeName": "Query",
         "RequestMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Query",
                                 "listAccountDatas",
                                 "req",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         },
         "ResponseMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Query",
                                 "listAccountDatas",
                                 "res",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         }
     }
 },
 "CreateAccountDataResolver": {
     "Type": "AWS::AppSync::Resolver",
     "Properties": {
         "ApiId": {
             "Ref": "GetAttGraphQLAPIApiId"
         },
         "DataSourceName": {
             "Fn::GetAtt": [
                 "AccountDataDataSource",
                 "Name"
             ]
         },
         "FieldName": "createAccountData",
         "TypeName": "Mutation",
         "RequestMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Mutation",
                                 "createAccountData",
                                 "req",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         },
         "ResponseMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Mutation",
                                 "createAccountData",
                                 "res",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         }
     }
 },
 "UpdateAccountDataResolver": {
     "Type": "AWS::AppSync::Resolver",
     "Properties": {
         "ApiId": {
             "Ref": "GetAttGraphQLAPIApiId"
         },
         "DataSourceName": {
             "Fn::GetAtt": [
                 "AccountDataDataSource",
                 "Name"
             ]
         },
         "FieldName": "updateAccountData",
         "TypeName": "Mutation",
         "RequestMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Mutation",
                                 "updateAccountData",
                                 "req",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         },
         "ResponseMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Mutation",
                                 "updateAccountData",
                                 "res",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         }
     }
 },
 "DeleteAccountDataResolver": {
     "Type": "AWS::AppSync::Resolver",
     "Properties": {
         "ApiId": {
             "Ref": "GetAttGraphQLAPIApiId"
         },
         "DataSourceName": {
             "Fn::GetAtt": [
                 "AccountDataDataSource",
                 "Name"
             ]
         },
         "FieldName": "deleteAccountData",
         "TypeName": "Mutation",
         "RequestMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Mutation",
                                 "deleteAccountData",
                                 "req",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         },
         "ResponseMappingTemplateS3Location": {
             "Fn::Sub": [
                 "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/${ResolverFileName}",
                 {
                     "S3DeploymentBucket": {
                         "Ref": "S3DeploymentBucket"
                     },
                     "S3DeploymentRootKey": {
                         "Ref": "S3DeploymentRootKey"
                     },
                     "ResolverFileName": {
                         "Fn::Join": [
                             ".",
                             [
                                 "Mutation",
                                 "deleteAccountData",
                                 "res",
                                 "vtl"
                             ]
                         ]
                     }
                 }
             ]
         }
     }
 }

},
"Outputs": {},
"Conditions": {
"APIKeyExpirationEpochIsNotNegOne": {
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "APIKeyExpirationEpoch"
},
-1
]
}
]
},
"APIKeyExpirationEpochIsPositive": {
"Fn::And": [
{
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "APIKeyExpirationEpoch"
},
-1
]
}
]
},
{
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "APIKeyExpirationEpoch"
},
0
]
}
]
}
]
},
"ShouldUsePayPerRequestBilling": {
"Fn::Equals": [
{
"Ref": "DynamoDBBillingMode"
},
"PAY_PER_REQUEST"
]
},
"AuthShouldCreateUserPool": {
"Fn::Equals": [
{
"Ref": "AuthCognitoUserPoolId"
},
"NONE"
]
},
"HasEnvironmentParameter": {
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "env"
},
"NONE"
]
}
]
}
}
}`

When I do amplify push I get these errors.
A. CREATE_IN_PROGRESS AccountDatajson                                              AWS::CloudFormation::Stack Sat Mar 09 2019 23:26:15 GM
T-0500 (Eastern Standard Time)
CREATE_FAILED      AccountDatajson                                              AWS::CloudFormation::Stack Sat Mar 09 2019 23:26:16 GM
T-0500 (Eastern Standard Time) Parameters: [GetAttGraphQLAPIApiId] must have values
CREATE_FAILED      amplify-notetaker-20190309085936-apinotetaker3-16H8H9AFOBTJ0 AWS::CloudFormation::Stack Sat Mar 09 2019 23:26:16 GM
T-0500 (Eastern Standard Time) The following resource(s) failed to create: [AccountDatajson].
Upon some analysis I noticed the that the compiled template generated this resource. I am not sure why this is getting generated.
       "AccountDatajson": {             "Type": "AWS::CloudFormation::Stack",             "Properties": {                 "Parameters": {                     "AppSyncApiName": {                         "Ref": "AppSyncApiName"                     },                     "APIKeyExpirationEpoch": {                         "Ref": "APIKeyExpirationEpoch"                     },                     "DynamoDBModelTableReadIOPS": {                         "Ref": "DynamoDBModelTableReadIOPS"                     },                     "DynamoDBModelTableWriteIOPS": {                         "Ref": "DynamoDBModelTableWriteIOPS"                     },                     "DynamoDBBillingMode": {                         "Ref": "DynamoDBBillingMode"                     },                     "AuthCognitoUserPoolId": {                         "Ref": "AuthCognitoUserPoolId"                     },                     "AuthCognitoUserPoolName": {                         "Ref": "AuthCognitoUserPoolName"                     },                     "AuthCognitoUserPoolMobileClientName": {                         "Ref": "AuthCognitoUserPoolMobileClientName"                     },                     "AuthCognitoUserPoolJSClientName": {                         "Ref": "AuthCognitoUserPoolJSClientName"                     },                     "AuthCognitoUserPoolRefreshTokenValidity": {                         "Ref": "AuthCognitoUserPoolRefreshTokenValidity"                     },                     "env": {                         "Ref": "env"                     },                     "S3DeploymentBucket": {                         "Ref": "S3DeploymentBucket"                     },                     "S3DeploymentRootKey": {                         "Ref": "S3DeploymentRootKey"                     },                     "AppSyncApiId": {                         "Fn::GetAtt": [                             "GraphQLAPI",                             "ApiId"                         ]                     }                 },                 "TemplateURL": {                     "Fn::Join": [                         "/",                         [                             "https://s3.amazonaws.com",                             {                                 "Ref": "S3DeploymentBucket"                             },                             {                                 "Ref": "S3DeploymentRootKey"                             },                             "stacks",                             "AccountData.json"                         ]                     ]                 }             },             "DependsOn": [                 "GraphQLAPI",                 "GraphQLSchema",                 "Todo",                 "AccountData"             ]         }
I am stuck and don't know how to move forward.

I have a follow up question as I was trying out the solution you suggested. If I did follow your solution will I be able to declare entities using schema.graphql and auto generate any code or will I have to do everything manually?

@djkingh01 For now, yes, you would have to implement everything yourself. We do want to support the use case where you can adopt an existing table for an @model type, but it has not yet been implemented. We have looked at a few approaches including expanding @model with new arguments as well as adding a new directive such as @table. If you are interested and want to contribute a potential design, I would be happy to review it.
P.S. We have also discussed opening up the CLI such that you can write and run your own transformers as part of the normal workflow. I'm curious how many people would want this feature?

I believe a lot of people should be interested. My usecase is such that we have an existing DynamoDB and code for CRUD with a pk/sk hierarchichal access pattern in a single table. Amplify is a great way to easily migrate out backend to graphql and reduce testing footprint. All we need is @sk and @datasource support in someway.
@sk so that the generated resolvers use a @pk/@sk before using queries.
@datasource - I can manually define or use custom cloudformation template.
Then use amplify to define and author the schema and go live. I am sure I am not the only one with this problem. In its current form the system only works for people who have new projects and that too I am not sure how many can have tables in their production with randomely generated tablenames that they cannoty control.

It took me a long time to get these right so sharing for others benefit.

Below is a Todo schema.graphql file that supports PrimaryKey, SortKey relationship.
Resolvers

`type Todo {
pk: String!
sk: String!
displayName: String
notes: String
}
input TodoKey {
pk: String!
sk: String!
}
input CreateTodoInput {
pk: String!
sk: String!
displayName: String
notes: String
}
type ModelTodoConnection {
items: [Todo]
nextToken: String
}
input ModelTodoFilterInput {
pk: ModelStringFilterInput
sk: ModelStringFilterInput
displayName: ModelStringFilterInput
notes: ModelStringFilterInput
and: [ModelTodoFilterInput]
or: [ModelTodoFilterInput]
not: ModelTodoFilterInput
}
input ModelBooleanFilterInput {
ne: Boolean
eq: Boolean
}
input ModelFloatFilterInput {
ne: Float
eq: Float
le: Float
lt: Float
ge: Float
gt: Float
contains: Float
notContains: Float
between: [Float]
}
input ModelIDFilterInput {
ne: ID
eq: ID
le: ID
lt: ID
ge: ID
gt: ID
contains: ID
notContains: ID
between: [ID]
beginsWith: ID
}
input ModelIntFilterInput {
ne: Int
eq: Int
le: Int
lt: Int
ge: Int
gt: Int
contains: Int
notContains: Int
between: [Int]
}
enum ModelSortDirection {
ASC
DESC
}
input ModelStringFilterInput {
ne: String
eq: String
le: String
lt: String
ge: String
gt: String
contains: String
notContains: String
between: [String]
beginsWith: String
}
type Mutation {
createTodo(input: CreateTodoInput!): Todo
updateTodo(input: UpdateTodoInput!): Todo
deleteTodo(input: TodoKey!): Todo
}
type Query {
getTodo(query: TodoKey!): Todo
listTodos(query: ModelTodoFilterInput, filter: ModelTodoFilterInput, limit: Int, nextToken: String): ModelTodoConnection
}
type Subscription {
onCreateTodo: Todo
@aws_subscribe(mutations: ["createTodo"])
onUpdateTodo: Todo
@aws_subscribe(mutations: ["updateTodo"])
onDeleteTodo: Todo
@aws_subscribe(mutations: ["deleteTodo"])
}
input UpdateTodoInput {
pk: String
sk: String
displayName: String
notes: String
}`
a. CreateTodo
`## [Start] Prepare DynamoDB PutItem Request. **
$util.qr($context.args.input.put("createdAt", $util.time.nowISO8601()))
$util.qr($context.args.input.put("updatedAt", $util.time.nowISO8601()))
$util.qr($context.args.input.put("__typename", "Todo"))
{
"version": "2017-02-28",
"operation": "PutItem",
"key": {
"pk":     $util.dynamodb.toDynamoDBJson($util.defaultIfNullOrBlank($ctx.args.input.pk, $util.autoId())),
"sk":     $util.dynamodb.toDynamoDBJson($util.defaultIfNullOrBlank($ctx.args.input.sk, $util.autoId()))
},
"attributeValues": $util.dynamodb.toMapValuesJson($context.args.input),
"condition": {
"expression": "attribute_not_exists(#pk) and attribute_not_exists(#sk) ",
"expressionNames": {
"#pk": "pk",
"#sk": "sk"
}
}
}
[End] Prepare DynamoDB PutItem Request. **`
b. DeleteTodo
#if( $authCondition )   #set( $condition = $authCondition )   $util.qr($condition.put("expression", "$condition.expression AND attribute_exists(#pk) AND attribute_exists(#sk) "))   $util.qr($condition.expressionNames.put("#pk", "pk"))   $util.qr($condition.expressionNames.put("#sk", "sk")) #else   #set( $condition = {   "expression": "attribute_exists(#pk) and attribute_exists(#sk) ",   "expressionNames": {       "#pk": "pk", 	  "#sk": "sk"   } } ) #end #if( $versionedCondition )   $util.qr($condition.put("expression", "($condition.expression) AND $versionedCondition.expression"))   $util.qr($condition.expressionNames.putAll($versionedCondition.expressionNames))   #set( $expressionValues = $util.defaultIfNull($condition.expressionValues, {}) )   $util.qr($expressionValues.putAll($versionedCondition.expressionValues))   #set( $condition.expressionValues = $expressionValues ) #end {   "version": "2017-02-28",   "operation": "DeleteItem",   "key": {       "pk": $util.dynamodb.toDynamoDBJson($ctx.args.input.pk), 	  "sk": $util.dynamodb.toDynamoDBJson($ctx.args.input.sk)   },   "condition": $util.toJson($condition) }
c. Update Todo
`#if( $authCondition && $authCondition.expression != "" )
#set( $condition = $authCondition )
$util.qr($condition.put("expression", "$condition.expression AND attribute_exists(#pk) AND attribute_exists(#sk)"))
$util.qr($condition.expressionNames.put("#pk", "pk"))
$util.qr($condition.expressionNames.put("#sk", "sk"))
#else
#set( $condition = {
"expression": "attribute_exists(#pk) and attribute_exists(#sk) ",
"expressionNames": {
"#pk": "pk",
"#sk": "sk"
},
"expressionValues": {}
} )
#end
Automatically set the updatedAt timestamp. **
$util.qr($context.args.input.put("updatedAt", $util.time.nowISO8601()))
$util.qr($context.args.input.put("__typename", "Todo"))
Update condition if type is @versioned **
#if( $versionedCondition )
$util.qr($condition.put("expression", "($condition.expression) AND $versionedCondition.expression"))
$util.qr($condition.expressionNames.putAll($versionedCondition.expressionNames))
$util.qr($condition.expressionValues.putAll($versionedCondition.expressionValues))
#end
#set( $expNames = {} )
#set( $expValues = {} )
#set( $expSet = {} )
#set( $expAdd = {} )
#set( $expRemove = [] )
#foreach( $entry in $util.map.copyAndRemoveAllKeys($context.args.input, ["pk","sk"]).entrySet() )
#if( $util.isNull($entry.value) )
#set( $discard = $expRemove.add("#$entry.key") )
$util.qr($expNames.put("#$entry.key", "$entry.key"))
#else
$util.qr($expSet.put("#$entry.key", ":$entry.key"))
$util.qr($expNames.put("#$entry.key", "$entry.key"))
$util.qr($expValues.put(":$entry.key", $util.dynamodb.toDynamoDB($entry.value)))
#end
#end
#set( $expression = "" )
#if( !$expSet.isEmpty() )
#set( $expression = "SET" )
#foreach( $entry in $expSet.entrySet() )
#set( $expression = "$expression $entry.key = $entry.value" )
#if( $foreach.hasNext() )
#set( $expression = "$expression," )
#end
#end
#end
#if( !$expAdd.isEmpty() )
#set( $expression = "$expression ADD" )
#foreach( $entry in $expAdd.entrySet() )
#set( $expression = "$expression $entry.key $entry.value" )
#if( $foreach.hasNext() )
#set( $expression = "$expression," )
#end
#end
#end
#if( !$expRemove.isEmpty() )
#set( $expression = "$expression REMOVE" )
#foreach( $entry in $expRemove )
#set( $expression = "$expression $entry" )
#if( $foreach.hasNext() )
#set( $expression = "$expression," )
#end
#end
#end
#set( $update = {} )
$util.qr($update.put("expression", "$expression"))
#if( !$expNames.isEmpty() )
$util.qr($update.put("expressionNames", $expNames))
#end
#if( !$expValues.isEmpty() )
$util.qr($update.put("expressionValues", $expValues))
#end
{
"version": "2017-02-28",
"operation": "UpdateItem",
"key": {
"pk": {
"S": "$context.args.input.pk"
},
"sk": {
"S": "$context.args.input.sk"
}
},
"update": $util.toJson($update),
"condition": $util.toJson($condition)
}`
d. ListTodo with support for queries
##* Using limit with filter expression can cause issues because imp. Dynamodb evaluates filter after limit. So filter could return 2 results that do not match filter expression*# #set( $limit = $util.defaultIfNull($context.args.limit, 10) ) {   "version": "2017-02-28",   "operation": "Query",     "query" : #if( $context.args.query ) 		$util.transform.toDynamoDBFilterExpression($ctx.args.query)   	#else 		null   	#end,     "filter":   #if( $context.args.filter )         $util.transform.toDynamoDBFilterExpression($ctx.args.filter)     #else         null     #end,     "limit": $limit,     "nextToken":   #if( $context.args.nextToken )         "$context.args.nextToken"     #else         null     #end }
e. GetTodo
{   "version": "2017-02-28",   "operation": "GetItem",   "key": {       "pk": $util.dynamodb.toDynamoDBJson($ctx.args.query.pk), 	  "sk": $util.dynamodb.toDynamoDBJson($ctx.args.query.sk)   } }

I created 1 stack for the custom table, datasource and role? How do I point to this stack from another stack where the schema definitions are created?

@mikeparisstuff

Currently the @model directive expects to contain a single data type, however, we are looking at generlizing this to allow overloaded indexes & multiple types per table but there is not set date on when this will be available. This being said, you are able to write your own resolvers that target your own data sources within the CLI using custom stacks.

My team is very interested in this feature. We've recently had a Well Architected Review with an AWS Solutions Architect and our AWS rep and one of the issues that came out of that was that we should consolidate all our types into one big table. We were told that was the proper usage of DynamoDB. I know you guys build features based on demand, so I am just commenting to vote on it.
Thanks for all your hard work!

+1. I'd like to use the auto-generated code but against a different table than the amplify cli default as well. This is needed to do https://github.com/aws-amplify/amplify-cli/issues/1037 and https://github.com/aws-amplify/amplify-cli/issues/202

@djkingh01 For now, yes, you would have to implement everything yourself. We do want to support the use case where you can adopt an existing table for an @model type, but it has not yet been implemented. We have looked at a few approaches including expanding @model with new arguments as well as adding a new directive such as @table. If you are interested and want to contribute a potential design, I would be happy to review it.
P.S. We have also discussed opening up the CLI such that you can write and run your own transformers as part of the normal workflow. I'm curious how many people would want this feature?

@mikeparisstuff I am interested in the @table directive (specifying a current table for @model..to support the best-practices of single table desing).  Single Table is "multiples types per table" design,

Are you any further on this design? can I get a beta version?
2.)   We do want to support the use case where you can adopt an existing table for an @model type, but it has not yet been implemented. We have looked at a few approaches including expanding @model with new arguments as well as adding a new directive such as @table. If you are interested and want to contribute a potential design, I would be happy to review it.
P.S. We have also discussed opening up the CLI such that you can write and run your own transformers as part of the normal workflow. I'm curious how many people would want this feature?

@mikeparisstuff I am interested in the @table directive (specifying a current table for @model..to support the best-practices of single table desing). Single Table is "multiples types per table" design,
Are you any further on this design? can I get a beta version?
2.) Are you openinging up the CLI to custome transformers/directives?

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1 I think it will be pretty useful if we can specify the table name.

+1 is this released yet? :)

+1

+1

+1 🔥🔥🔥 !!

+1

+1

+1

+1

+1

+1

+1

A possible workaround I've come across is Override (https://docs.amplify.aws/cli/graphql/override/#customize-amplify-generated-appsync-graphql-api-resources)
So, do an:
 amplify override api

Update the tablename in the override.ts as:
resources.models["Todo"].modelDDBTable.tableName = "tod";

That created a table named 'tod' (without the randomly generated string attached to it). I tested the mutations and subscriptions via the console and it works great!
Unfortunately, for me it didn't solve my problem because I already have an existing table for the api and when I run amplify push it failed. With the error:  already exists.
But I thought I'd put my findings here as it could help others that want to rename the table.

An alternative to using custom names for new DynamoDB tables is cdk-appsync-transformer.
This project replaces the Amplify CLI with CDK, so it's a pretty big change if you don't use it already.


Is there any plan to provide an Java SDK for this cachelib ?

Hi guys.
I think the cachelib is a quite interesting libary which solves the combined RAM and SSD cache issue.  I notice this interesting library because I'm considering how to maintain the recently queried dataset in the local SSD for speeding the Apache Spark queries.  ( I think the commecial databricks products has implemented this interesting feature, please see [1]). Saying The spark's executor will maintain its chunks (can be 1MB or 512KB) into the local SSD once the query accessed the column data from remote object storage ( aws s3 or azure blobstore).
After reading the cachelib paper [2],  I think this project may be the perfect open source candidate to maintain the cache chunks. So my questions are:
A.  Is there any plan to provide an Java SDK for this library ? Or do you know any others has tried to accomplish that ?  It's okay if nobody is currently working on this part,  I think I can try to implement this Java SDK if we decided to choose cachelib finally :-)
B. Is there any plan to support compiling in MacOS ?   It is just a tiny question, since seems our teams are currently using MacOS to    develop the projects. It's okay if we don't have any plan to support MacOS, we can also accomplish the Java SDK in linux.

https://docs.databricks.com/en/optimizations/disk-cache.html
https://www.usenix.org/system/files/osdi20-berg.pdf

Best Regrads.

Hi @openinx: Thanks for reaching out!
A. We don't have a plan to provide Java SDK for now.
B. For MacOS compiling, the code is available at: https://github.com/agordon/CacheLib/tree/macos-v40 (note this is the macos-v40 branch, not “main” branch). Could you try the following and see if it works (it was introduced long time ago, so I'm not sure if it still works):
$ git clone --branch macos-v40 https://github.com/agordon/CacheLib.git
$ cd CacheLib
$ ./contrib/macos-01-brew.sh

Install dependencies:
$ ./contrib/macos-02-build-dependencies.sh

Build CacheLib:
$ ./contrib/macos-03-build-cachelib.sh

Got it,  thanks @jiayuebao for the info.
The MacOS compiling links is really helpful !


Add ParameterStoreReadOnly roles

🗣 Description
This PR adds two additional ParameterStoreReadOnly roles (production and staging) to the set of roles that assessment provisioners are allowed to assume.

💭 Motivation and context
With the recent changes in https://github.com/cisagov/cool-assessment-terraform/pull/154 (specifically https://github.com/cisagov/cool-assessment-terraform/pull/154/commits/bf36200668404d47aa91a9ad8b8585c96b62ab00), access to these roles is now required for assessment provisioners.  One of the provisioners notified me that today they suddenly started getting an error about not being able to assume the ParameterStoreReadOnly role while attempting to apply the Terraform in cool-assessment-terraform.

🧪 Testing
I applied these changes and then verified that an account provisioner was able to successfully apply the code in cool-assessment-terraform.

✅ Checklist

[x] This PR has an informative and human-readable title.
[x] Changes are limited to a single goal - eschew scope creep!
[x] All relevant type-of-change labels have been added.
[x] I have read the CONTRIBUTING document.
[x] These code changes follow cisagov code standards.
[x] All new and existing tests pass.

What's up with the GH Actions checks?

What's up with the GH Actions checks?

Fixed that by removing the test and CodeQL check requirements in the branch protection rule, since those checks don't run in this repo.