Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
amplience-graphql-codegen-terraform
Advanced tools
This is a plugin for GraphQL Codegen that outputs your schema to Amplience resources in Terraform.
This is a plugin for GraphQL Codegen that outputs your schema to Amplience resources in Terraform.
It will look for types with an @amplienceContentType
directive and generate Terraform resources that create Amplience Content Types.
This terraform code is dependent on the Amplience Terraform provider.
Furthermore, this plugin requires amplience-graphql-codegen-json
to generate the necessary JSON files the terraform code refers to.
For an example output see the example output terraform file.
For more information on the Amplience Terraform provider, see the documentation on the terraform registry.
A basic example:
overwrite: true
schema: ./schema.graphql
hooks:
afterAllFileWrite:
- terraform fmt
generates:
terraform/amplience_content_types.tf:
plugins:
- amplience-graphql-codegen-terraform
config:
hostname: "https://schema-examples.com"
visualization:
- label: Localhost with layout
templated_uri: https://example.com/preview?vse={{vse.domain}}&content={{content.sys.id}}
default: false
content_repositories:
website1: var.variables["CONTENT_REPO1_ID"] # A terraform variable.
website2: 1234567890123456789 # A direct content repo id value.
website3: ${WEBSITE_3} # A environment variable.
slot_repositories:
slot1: var.variables["SLOT_REPO1_ID"]
slot2: var.variables["SLOT_REPO2_ID"]
add_required_provider: true # defaulted to true, will generate required_providers block, removed otherwise
The hostname
is optional and will default to https://schema-examples.com
.
This is a prefix that is used to define the JSON schema resources and should be a URL.
The visualization
is also optional.
The values for the visualization
, the content_repositories
, and the slot_repositories
can either be a direct value,
an environment variable using the ${MY_VAR}
syntax, or a reference to a terraform variable.
Basic example:
type MyContentType @amplienceContentType {
...
}
By default this will generate Terraform resources for a content type named "my-content-type". It will be assigned to the first repository (e.g. website1).
You can change the repository and its validationLevel by specifying those as arguments.
Please note that if you use a SLOT
validation level, you should refer to one within the slot_repositories
or otherwise it will default to the first slot repository.
You can also enable visualizations for this type by setting that argument to true.
Optionally, you can also add @icon(url: 'some-test-url')
. This will add icon support for the Amplience content-type
Additionally, you can also add autoSync
into the directive. This is an optional directive that accepts boolean (defaulted to true
). This will allow autoSync
to be in place.
Note that this only available from Amplience Terraform Provider version >= 0.4.0
A full example you can see below:
type MyContentType @amplienceContentType(
repository: "slot2", # To overwrite the default repository (first)
kind: SLOT, # Can either be CONTENT_TYPE (default), SLOT, or HIERARCHY
visualizations: true, # If true, it will add the visualizations defined in the codegen.yml
icon: "http://example.com/icon.png"
autoSync: true # Optional field, defaulted to `true` if not specified, and it will allow content-type to be sync-ed automatically
) {
...
}
Note that partials are not supported.
Instead you could just inline all the partials using amplience-graphql-codegen-json
.
FAQs
This is a plugin for GraphQL Codegen that outputs your schema to Amplience resources in Terraform.
The npm package amplience-graphql-codegen-terraform receives a total of 1,200 weekly downloads. As such, amplience-graphql-codegen-terraform popularity was classified as popular.
We found that amplience-graphql-codegen-terraform demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.