Core Concepts
...
Components
CloudFormation

Custom Input Params

3min

When working with CloudFormation components in Microtica, you may find the need to add custom input parameters to your templates. These parameters can help make your components more flexible and configurable.

Step 1: Update the JSON Schema (schema.json)

First, you need to define the new AccessControl parameter in the schema.json file. This will ensure that the parameter is visible and configurable in the Microtica Console.

Here is how you can update the schema.json file:

JSON
๏ปฟ

In this update:

  • The AccessControl parameter is added under properties with the description and two allowed values (enum): "Private" and "PublicRead".
  • The parameter is also included in the required array to ensure it must be provided during deployment.

Step 2: Update the CloudFormation Template (index.json)

Next, you need to update the index.json file to include the new AccessControl parameter in the CloudFormation template. This parameter will be used to set the appropriate access control policy on the S3 bucket.

Hereโ€™s the updated index.json file:

JSON
๏ปฟ

In this update:

  • The AccessControl parameter is added under Parameters, with allowed values "Private" and "PublicRead". The default value is set to "Private".
  • The AccessControl property is referenced in the S3Bucket resource definition, linking it to the corresponding parameter value provided during deployment.

๏ปฟ

Updated 14 Aug 2024
Doc contributor
Did this page help you?