CreateComponentCommand

Create an Proton component. A component is an infrastructure extension for a service instance.

For more information about components, see Proton components  in the Proton User Guide.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ProtonClient, CreateComponentCommand } from "@aws-sdk/client-proton"; // ES Modules import
// const { ProtonClient, CreateComponentCommand } = require("@aws-sdk/client-proton"); // CommonJS import
const client = new ProtonClient(config);
const input = { // CreateComponentInput
  name: "STRING_VALUE", // required
  description: "STRING_VALUE",
  serviceName: "STRING_VALUE",
  serviceInstanceName: "STRING_VALUE",
  environmentName: "STRING_VALUE",
  templateFile: "STRING_VALUE", // required
  manifest: "STRING_VALUE", // required
  serviceSpec: "STRING_VALUE",
  tags: [ // TagList
    { // Tag
      key: "STRING_VALUE", // required
      value: "STRING_VALUE", // required
    },
  ],
  clientToken: "STRING_VALUE",
};
const command = new CreateComponentCommand(input);
const response = await client.send(command);
// { // CreateComponentOutput
//   component: { // Component
//     name: "STRING_VALUE", // required
//     description: "STRING_VALUE",
//     arn: "STRING_VALUE", // required
//     environmentName: "STRING_VALUE", // required
//     serviceName: "STRING_VALUE",
//     serviceInstanceName: "STRING_VALUE",
//     createdAt: new Date("TIMESTAMP"), // required
//     lastModifiedAt: new Date("TIMESTAMP"), // required
//     lastDeploymentAttemptedAt: new Date("TIMESTAMP"),
//     lastDeploymentSucceededAt: new Date("TIMESTAMP"),
//     deploymentStatus: "STRING_VALUE", // required
//     deploymentStatusMessage: "STRING_VALUE",
//     serviceSpec: "STRING_VALUE",
//     lastClientRequestToken: "STRING_VALUE",
//     lastAttemptedDeploymentId: "STRING_VALUE",
//     lastSucceededDeploymentId: "STRING_VALUE",
//   },
// };

CreateComponentCommand Input

See CreateComponentCommandInput for more details

Parameter
Type
Description
manifest
Required
string | undefined

A path to a manifest file that lists the Infrastructure as Code (IaC) file, template language, and rendering engine for infrastructure that a custom component provisions.

name
Required
string | undefined

The customer-provided name of the component.

templateFile
Required
string | undefined

A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.

Components support a single IaC file, even if you use Terraform as your template language.

clientToken
string | undefined

The client token for the created component.

description
string | undefined

An optional customer-provided description of the component.

environmentName
string | undefined

The name of the Proton environment that you want to associate this component with. You must specify this when you don't specify serviceInstanceName and serviceName.

serviceInstanceName
string | undefined

The name of the service instance that you want to attach this component to. If you don't specify this, the component isn't attached to any service instance. Specify both serviceInstanceName and serviceName or neither of them.

serviceName
string | undefined

The name of the service that serviceInstanceName is associated with. If you don't specify this, the component isn't attached to any service instance. Specify both serviceInstanceName and serviceName or neither of them.

serviceSpec
string | undefined

The service spec that you want the component to use to access service inputs. Set this only when you attach the component to a service instance.

tags
Tag[] | undefined

An optional list of metadata items that you can associate with the Proton component. A tag is a key-value pair.

For more information, see Proton resources and tagging  in the Proton User Guide.

CreateComponentCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
component
Required
Component | undefined

The detailed data of the created component.

Throws

Name
Fault
Details
AccessDeniedException
client

There isn't sufficient access for performing this action.

ConflictException
client

The request couldn't be made due to a conflicting operation or resource.

InternalServerException
server

The request failed to register with the service.

ResourceNotFoundException
client

The requested resource wasn't found.

ServiceQuotaExceededException
client

A quota was exceeded. For more information, see Proton Quotas  in the Proton User Guide.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The input is invalid or an out-of-range value was supplied for the input parameter.

ProtonServiceException
Base exception class for all service exceptions from Proton service.