AWS Terraform

AWS Terraform

Terraform on AWS best practices, infrastructure as code patterns, and security compliance with Checkov.

10K+

7 Tools

Packaged by
Add to Docker Desktop

Version 4.43 or later needs to be installed to add the server automatically

Use cases

Search AWSCC provider documentation for resources and attributes. The AWSCC provider is based on the AWS Cloud Control API and provides a more consistent interface to AWS resources compared to the standard AWS provider. This tool searches the Terraform AWSCC provider documentation for information about a specific asset in the AWSCC Provider Documentation, assets can be either resources or data sources. It retrieves comprehensive details including descriptions, example code snippets, and schema references. Use the 'asset_type' parameter to specify if you are looking for information about provider resources, data sources, or both. Valid values are 'resource', 'data_source' or 'both'. The tool will automatically handle prefixes - you can search for either 'awscc_s3_bucket' or 's3_bucket'. Examples: - To get documentation for an S3 bucket resource: search_awscc_provider_docs(asset_name='awscc_s3_bucket') search_awscc_provider_docs(asset_name='awscc_s3_bucket', asset_type='resource') - To search only for data sources: search_aws_provider_docs(asset_name='awscc_appsync_api', kind='data_source') - To search for both resource and data source documentation of a given name: search_aws_provider_docs(asset_name='awscc_appsync_api', kind='both') - Search of a resource without the prefix: search_awscc_provider_docs(resource_type='ec2_instance') Parameters: asset_name: Name of the AWSCC Provider resource or data source to look for (e.g., 'awscc_s3_bucket', 'awscc_lambda_function') asset_type: Type of documentation to search - 'resource' (default), 'data_source', or 'both'. Some resources and data sources share the same name Returns: A list of matching documentation entries with details including: - Resource name and description - URL to the official documentation - Example code snippets - Schema information (required, optional, read-only, and nested structures attributes)

Search for specific AWS-IA Terraform modules. This tool checks for information about four specific AWS-IA modules: - aws-ia/bedrock/aws - Amazon Bedrock module for generative AI applications - aws-ia/opensearch-serverless/aws - OpenSearch Serverless collection for vector search - aws-ia/sagemaker-endpoint/aws - SageMaker endpoint deployment module - aws-ia/serverless-streamlit-app/aws - Serverless Streamlit application deployment It returns detailed information about these modules, including their README content, variables.tf content, and submodules when available. The search is performed across module names, descriptions, README content, and variable definitions. This allows you to find modules based on their functionality or specific configuration options. Examples: - To get information about all four modules: search_specific_aws_ia_modules() - To find modules related to Bedrock: search_specific_aws_ia_modules(query='bedrock') - To find modules related to vector search: search_specific_aws_ia_modules(query='vector search') - To find modules with specific configuration options: search_specific_aws_ia_modules(query='endpoint_name') Parameters: query: Optional search term to filter modules (empty returns all four modules) Returns: A list of matching modules with their details, including: - Basic module information (name, namespace, version) - Module documentation (README content) - Input and output parameter counts - Variables from variables.tf with descriptions and default values - Submodules information - Version details and release information

About

AWS Terraform MCP Server

Terraform on AWS best practices, infrastructure as code patterns, and security compliance with Checkov.

What is an MCP Server?

Characteristics

AttributeDetails
Docker Imagemcp/aws-terraform
Authorawslabs
Repositoryhttps://github.com/awslabs/mcp
Dockerfilehttps://github.com/awslabs/mcp/blob/main/src/terraform-mcp-server/Dockerfile
Docker Image built byDocker Inc.
Docker Scout Health ScoreDocker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/aws-terraform --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceApache License 2.0

Available Tools (7)

Tools provided by this ServerShort Description
ExecuteTerraformCommandExecute Terraform workflow commands against an AWS account.
ExecuteTerragruntCommandExecute Terragrunt workflow commands against an AWS account.
RunCheckovScanRun Checkov security scan on Terraform code.
SearchAwsProviderDocsSearch AWS provider documentation for resources and attributes.
SearchAwsccProviderDocsSearch AWSCC provider documentation for resources and attributes.
SearchSpecificAwsIaModulesSearch for specific AWS-IA Terraform modules.
SearchUserProvidedModuleSearch for a user-provided Terraform registry module and understand its inputs, outputs, and usage.

Tools Details

Tool: ExecuteTerraformCommand

Execute Terraform workflow commands against an AWS account.

This tool runs Terraform commands (init, plan, validate, apply, destroy) in the specified working directory, with optional variables and region settings.

Parameters: command: Terraform command to execute working_directory: Directory containing Terraform files variables: Terraform variables to pass aws_region: AWS region to use strip_ansi: Whether to strip ANSI color codes from output

Returns: A TerraformExecutionResult object containing command output and status

ParametersTypeDescription
commandstringTerraform command to execute
working_directorystringDirectory containing Terraform files
aws_regionstringoptionalAWS region to use
strip_ansibooleanoptionalWhether to strip ANSI color codes from output
variablesstringoptionalTerraform variables to pass

Tool: ExecuteTerragruntCommand

Execute Terragrunt workflow commands against an AWS account.

This tool runs Terragrunt commands (init, plan, validate, apply, destroy, run-all) in the specified working directory, with optional variables and region settings. Terragrunt extends Terraform's functionality by providing features like remote state management, dependencies between modules, and the ability to execute Terraform commands on multiple modules at once.

Parameters: command: Terragrunt command to execute working_directory: Directory containing Terragrunt files variables: Terraform variables to pass aws_region: AWS region to use strip_ansi: Whether to strip ANSI color codes from output include_dirs: Directories to include in a multi-module run exclude_dirs: Directories to exclude from a multi-module run run_all: Run command on all modules in subdirectories terragrunt_config: Path to a custom terragrunt config file (not valid with run-all)

Returns: A TerragruntExecutionResult object containing command output and status

ParametersTypeDescription
commandstringTerragrunt command to execute
working_directorystringDirectory containing Terragrunt files
aws_regionstringoptionalAWS region to use
exclude_dirsstringoptionalDirectories to exclude from a multi-module run
include_dirsstringoptionalDirectories to include in a multi-module run
run_allbooleanoptionalRun command on all modules in subdirectories
strip_ansibooleanoptionalWhether to strip ANSI color codes from output
terragrunt_configstringoptionalPath to a custom terragrunt config file (not valid with run-all)
variablesstringoptionalTerraform variables to pass

Tool: RunCheckovScan

Run Checkov security scan on Terraform code.

This tool runs Checkov to scan Terraform code for security and compliance issues, identifying potential vulnerabilities and misconfigurations according to best practices.

Checkov (https://www.checkov.io/) is an open-source static code analysis tool that can detect hundreds of security and compliance issues in infrastructure-as-code.

Parameters: working_directory: Directory containing Terraform files to scan framework: Framework to scan (default: terraform) check_ids: Optional list of specific check IDs to run skip_check_ids: Optional list of check IDs to skip output_format: Format for scan results (default: json)

Returns: A CheckovScanResult object containing scan results and identified vulnerabilities

ParametersTypeDescription
working_directorystringDirectory containing Terraform files
check_idsstringoptionalSpecific check IDs to run
frameworkstringoptionalFramework to scan (terraform, cloudformation, etc.)
output_formatstringoptionalOutput format (json, cli, etc.)
skip_check_idsstringoptionalCheck IDs to skip

Tool: SearchAwsProviderDocs

Search AWS provider documentation for resources and attributes.

This tool searches the Terraform AWS provider documentation for information about a specific asset in the AWS Provider Documentation, assets can be either resources or data sources. It retrieves comprehensive details including descriptions, example code snippets, argument references, and attribute references.

Use the 'asset_type' parameter to specify if you are looking for information about provider resources, data sources, or both. Valid values are 'resource', 'data_source' or 'both'.

The tool will automatically handle prefixes - you can search for either 'aws_s3_bucket' or 's3_bucket'.

Examples: - To get documentation for an S3 bucket resource: search_aws_provider_docs(asset_name='aws_s3_bucket')

- To search only for data sources:
  search_aws_provider_docs(asset_name='aws_ami', asset_type='data_source')

- To search for both resource and data source documentation of a given name:
  search_aws_provider_docs(asset_name='aws_instance', asset_type='both')

Parameters: asset_name: Name of the service (asset) to look for (e.g., 'aws_s3_bucket', 'aws_lambda_function') asset_type: Type of documentation to search - 'resource' (default), 'data_source', or 'both'

Returns: A list of matching documentation entries with details including: - Resource name and description - URL to the official documentation - Example code snippets - Arguments with descriptions - Attributes with descriptions

ParametersTypeDescription
asset_namestringName of the AWS service (asset) to look for (e.g., "aws_s3_bucket", "aws_lambda_function")
asset_typestringoptionalType of documentation to search - 'resource' (default), 'data_source', or 'both'

Tool: SearchAwsccProviderDocs

Search AWSCC provider documentation for resources and attributes.

The AWSCC provider is based on the AWS Cloud Control API and provides a more consistent interface to AWS resources compared to the standard AWS provider.

This tool searches the Terraform AWSCC provider documentation for information about a specific asset in the AWSCC Provider Documentation, assets can be either resources or data sources. It retrieves comprehensive details including descriptions, example code snippets, and schema references.

Use the 'asset_type' parameter to specify if you are looking for information about provider resources, data sources, or both. Valid values are 'resource', 'data_source' or 'both'.

The tool will automatically handle prefixes - you can search for either 'awscc_s3_bucket' or 's3_bucket'.

Examples: - To get documentation for an S3 bucket resource: search_awscc_provider_docs(asset_name='awscc_s3_bucket') search_awscc_provider_docs(asset_name='awscc_s3_bucket', asset_type='resource')

- To search only for data sources:
  search_aws_provider_docs(asset_name='awscc_appsync_api', kind='data_source')

- To search for both resource and data source documentation of a given name:
  search_aws_provider_docs(asset_name='awscc_appsync_api', kind='both')

- Search of a resource without the prefix:
  search_awscc_provider_docs(resource_type='ec2_instance')

Parameters: asset_name: Name of the AWSCC Provider resource or data source to look for (e.g., 'awscc_s3_bucket', 'awscc_lambda_function') asset_type: Type of documentation to search - 'resource' (default), 'data_source', or 'both'. Some resources and data sources share the same name

Returns: A list of matching documentation entries with details including: - Resource name and description - URL to the official documentation - Example code snippets - Schema information (required, optional, read-only, and nested structures attributes)

ParametersTypeDescription
asset_namestringName of the AWSCC service (asset) to look for (e.g., awscc_s3_bucket, awscc_lambda_function)
asset_typestringoptionalType of documentation to search - 'resource' (default), 'data_source', or 'both'

Tool: SearchSpecificAwsIaModules

Search for specific AWS-IA Terraform modules.

This tool checks for information about four specific AWS-IA modules:

  • aws-ia/bedrock/aws - Amazon Bedrock module for generative AI applications
  • aws-ia/opensearch-serverless/aws - OpenSearch Serverless collection for vector search
  • aws-ia/sagemaker-endpoint/aws - SageMaker endpoint deployment module
  • aws-ia/serverless-streamlit-app/aws - Serverless Streamlit application deployment

It returns detailed information about these modules, including their README content, variables.tf content, and submodules when available.

The search is performed across module names, descriptions, README content, and variable definitions. This allows you to find modules based on their functionality or specific configuration options.

Examples: - To get information about all four modules: search_specific_aws_ia_modules()

- To find modules related to Bedrock:
  search_specific_aws_ia_modules(query='bedrock')

- To find modules related to vector search:
  search_specific_aws_ia_modules(query='vector search')

- To find modules with specific configuration options:
  search_specific_aws_ia_modules(query='endpoint_name')

Parameters: query: Optional search term to filter modules (empty returns all four modules)

Returns: A list of matching modules with their details, including: - Basic module information (name, namespace, version) - Module documentation (README content) - Input and output parameter counts - Variables from variables.tf with descriptions and default values - Submodules information - Version details and release information

ParametersTypeDescription
querystringOptional search term to filter modules (empty returns all four modules)

Tool: SearchUserProvidedModule

Search for a user-provided Terraform registry module and understand its inputs, outputs, and usage.

This tool takes a Terraform registry module URL and analyzes its input variables, output variables, README, and other details to provide comprehensive information about the module.

The module URL should be in the format "namespace/name/provider" (e.g., "hashicorp/consul/aws") or "registry.terraform.io/namespace/name/provider".

Examples: - To search for the HashiCorp Consul module: search_user_provided_module(module_url='hashicorp/consul/aws')

- To search for a specific version of a module:
  search_user_provided_module(module_url='terraform-aws-modules/vpc/aws', version='3.14.0')

- To search for a module with specific variables:
  search_user_provided_module(
      module_url='terraform-aws-modules/eks/aws',
      variables={'cluster_name': 'my-cluster', 'vpc_id': 'vpc-12345'}
  )

Parameters: module_url: URL or identifier of the Terraform module (e.g., "hashicorp/consul/aws") version: Optional specific version of the module to analyze variables: Optional dictionary of variables to use when analyzing the module

Returns: A SearchUserProvidedModuleResult object containing module information

ParametersTypeDescription
module_urlstringURL or identifier of the Terraform module (e.g., "hashicorp/consul/aws")
variablesstringoptionalVariables to use when analyzing the module
versionstringoptionalSpecific version of the module to analyze

Use this MCP Server

{
  "mcpServers": {
    "aws-terraform": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/aws-terraform"
      ]
    }
  }
}

Why is it safer to run MCP Servers with Docker?

Manual installation

You can install the MCP server using:

Installation for

Related servers