Codification

The Codification API allows you to generate Infrastructure as Code (Terraform HCL) for cloud assets programmatically.

Codify Asset

Codify a single cloud asset to Infrastructure as Code

post

Generate IaC code (Terraform HCL) for a specific cloud asset

Authorizations
AuthorizationstringRequired

JWT authentication token

Body
assetTypestringRequired

The Terraform asset type (e.g., aws_s3_bucket)

assetIdstringRequired

The unique identifier of the cloud asset (e.g., ARN)

iacTypestring · enumRequired

The Infrastructure as Code type

Possible values:
providerstringRequired

The cloud provider (e.g., aws, azure, gcp)

accountNumberstringRequired

The cloud account number/ID

ignoreEscapingbooleanOptional

If true, returns raw HCL without escaping newlines

Default: false
Responses
chevron-right
200

Successfully codified asset

application/json
post
/api/codify

List Module Repositories

Fetches repositories

get

Fetches repositories that contain terraform modules

Authorizations
AuthorizationstringRequired

JWT authentication token

Query parameters
resourceTypesstring[]Required
Responses
chevron-right
200

Successfully retrieved module repos

application/json
get
/api/codify/repos

List Modules

Fetches modules from a given repository

get

Fetches modules available in a repository

Authorizations
AuthorizationstringRequired

JWT authentication token

Query parameters
repositorystringRequired

Full repository path (e.g., owner/name/subdirectory)

resourceTypesstring[]Required

List of resource types to filter modules by, separated by commas

Responses
chevron-right
200

Successfully fetched modules

application/json
get
/api/codify/repos/modules

Codify Module

Create a module call

post

Create a module call using the provided resource along with its dependencies

Authorizations
AuthorizationstringRequired

JWT authentication token

Body
assetIdstringRequired

The id of the resource to be codified using module call

assetTypestringRequired

The Terraform asset type (e.g. aws_s3_bucket)

formatstring · enumOptional

The format of the codified result (e.g. terraform, json)

Default: HCLPossible values:
moduleMD5stringRequired

The MD5 hash of the module path

repoProtocolstring · enumOptional

The protocol to reach the module's repository

Default: sshPossible values:
providerstring · enumRequired

The provider of the resource type

Possible values:
providerIdstringRequired

The Firefly integration ID where the resource is located

sourceTypestring · enumRequired

The source type of the module (e.g. private, public)

Possible values:
withAibooleanOptional

Whether to use AI to codify the module

Default: true
Responses
chevron-right
200

Successful module call

application/json
post
/api/codify/module

Create Module

Create a new module

post

Create a new module using the provided resource

Authorizations
AuthorizationstringRequired

JWT authentication token

Body
assetIdstringRequired

The id of the resource to be codified using create module

assetTypestringRequired

The Terraform asset type (e.g. aws_s3_bucket)

providerstring · enumRequired

The provider of the resource type

Possible values:
providerIdstringRequired

The Firefly integration ID where the resource is located

tfVersionstringOptional

The Terraform version to use from the specified provider

withAibooleanOptional

Whether to use AI to create the module

Default: true
withDependenciesbooleanOptional

Whether to include dependencies in the module (only available when withAi is true)

Default: false
Responses
chevron-right
200

Successfully created module

application/json
post
/api/codify/module/create

Create Pull Request

Create a pull request with codified assets

post

Creates a pull request containing Infrastructure as Code for specified cloud resources

Authorizations
AuthorizationstringRequired

JWT authentication token

Body
vcsIdstringRequired

VCS integration ID

repositorystringRequired

Repository full name (e.g., org/repo)

iacTypestring · enumRequired

Infrastructure as Code type

Possible values:
prCommentstringOptional

Comment to include in the pull request description

fileNamestringOptional

File path for the codified output

selectedBranchstringOptional

Target branch name (defaults to main/master)

Responses
chevron-right
200

Successfully created pull request

application/json
post
/api/codify/pullRequest

List Module Repositories

Fetches repositories

get

Fetches repositories that contain terraform modules

Authorizations
AuthorizationstringRequired

JWT authentication token

Query parameters
resourceTypesstring[]Required
Responses
chevron-right
200

Successfully retrieved module repos

application/json
get
/api/codify/repos

List Modules

Fetches modules from a given repository

get

Fetches modules available in a repository

Authorizations
AuthorizationstringRequired

JWT authentication token

Query parameters
repositorystringRequired

Full repository path (e.g., owner/name/subdirectory)

resourceTypesstring[]Required

List of resource types to filter modules by, separated by commas

Responses
chevron-right
200

Successfully fetched modules

application/json
get
/api/codify/repos/modules

Codify Module

Create a module call

post

Create a module call using the provided resource along with its dependencies

Authorizations
AuthorizationstringRequired

JWT authentication token

Body
assetIdstringRequired

The id of the resource to be codified using module call

assetTypestringRequired

The Terraform asset type (e.g. aws_s3_bucket)

formatstring · enumOptional

The format of the codified result (e.g. terraform, json)

Default: HCLPossible values:
moduleMD5stringRequired

The MD5 hash of the module path

repoProtocolstring · enumOptional

The protocol to reach the module's repository

Default: sshPossible values:
providerstring · enumRequired

The provider of the resource type

Possible values:
providerIdstringRequired

The Firefly integration ID where the resource is located

sourceTypestring · enumRequired

The source type of the module (e.g. private, public)

Possible values:
withAibooleanOptional

Whether to use AI to codify the module

Default: true
Responses
chevron-right
200

Successful module call

application/json
post
/api/codify/module

Create Module

Create a new module

post

Create a new module using the provided resource

Authorizations
AuthorizationstringRequired

JWT authentication token

Body
assetIdstringRequired

The id of the resource to be codified using create module

assetTypestringRequired

The Terraform asset type (e.g. aws_s3_bucket)

providerstring · enumRequired

The provider of the resource type

Possible values:
providerIdstringRequired

The Firefly integration ID where the resource is located

tfVersionstringOptional

The Terraform version to use from the specified provider

withAibooleanOptional

Whether to use AI to create the module

Default: true
withDependenciesbooleanOptional

Whether to include dependencies in the module (only available when withAi is true)

Default: false
Responses
chevron-right
200

Successfully created module

application/json
post
/api/codify/module/create

Create Pull Request

Create a pull request with codified assets

post

Creates a pull request containing Infrastructure as Code for specified cloud resources

Authorizations
AuthorizationstringRequired

JWT authentication token

Body
vcsIdstringRequired

VCS integration ID

repositorystringRequired

Repository full name (e.g., org/repo)

iacTypestring · enumRequired

Infrastructure as Code type

Possible values:
prCommentstringOptional

Comment to include in the pull request description

fileNamestringOptional

File path for the codified output

selectedBranchstringOptional

Target branch name (defaults to main/master)

Responses
chevron-right
200

Successfully created pull request

application/json
post
/api/codify/pullRequest

Last updated

Was this helpful?