Rescue

post

Refactor Terraform codebase by extracting variables from resources and modules to separated files

🔒 Requires the read:rescue permission

Authorizations
Body
terraformstring · binaryRequiredExample: [email protected]
iac_typestring · enumOptional

The type of IaC source

Default: terraformPossible values:
Responses
200

Zip archive of refactored data

application/zip
Responsestring · binary
post
/api/v1/rescue/tf/extract
POST /api/v1/rescue/tf/extract HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 63

{
  "terraform": "[email protected]",
  "iac_type": "terraform"
}
binary
post

Generate bricks file template from IaC source

🔒 Requires the read:rescue permission

Authorizations
Body
sourcestringRequired

The path to the IaC source directory

package_namestringRequired

The package name e.g. @bluebricks/aws-vpc

iac_typestring · enumRequired

The type of IaC source

Possible values:
Responses
200

Generated bricks file template

application/json
post
/api/v1/rescue
POST /api/v1/rescue HTTP/1.1
Host: api.bluebricks.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 62

{
  "source": "text",
  "package_name": "text",
  "iac_type": "terraform"
}
{
  "name": "@bluebricks/aws-vpc",
  "description": "A package for blueprinting a secure VPC",
  "version": "1.2.3",
  "tags": [
    "my-tag"
  ],
  "manifest_version": 1,
  "state": "managed",
  "repository": {
    "type": "text",
    "url": "text"
  },
  "props": {
    "ANY_ADDITIONAL_PROPERTY": {
      "type": "string",
      "description": "The name of the VPC",
      "default": "my-vpc",
      "value": "my-vpc1",
      "allowed_values": [
        "my-vpc"
      ],
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  },
  "computed": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "outs": {
    "ANY_ADDITIONAL_PROPERTY": {
      "type": "string",
      "description": "The VPC ID",
      "value": "my-vpc123",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  },
  "packages": [
    {
      "id": "s3",
      "name": "terraform-aws-s3",
      "version": "1.2.3",
      "props": {
        "region": {
          "value": "'us-west-2'"
        },
        "vpc_id": {
          "value": "Props.vpc_id ?? Data.vpc1.vpc_id"
        }
      },
      "path": "https://github.com/bb/vpc.git",
      "kind": "terraform",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "native": {
    "type": "terraform",
    "version": "text",
    "path": "text",
    "state_path": "text",
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Last updated

Was this helpful?