AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates a new custom action that can be used in all pipelines associated with the AWS account. Only used for custom actions.

Note:

For PCL this operation is only available in asynchronous form. Please refer to CreateCustomActionTypeAsync.

Namespace: Amazon.CodePipeline
Assembly: AWSSDK.CodePipeline.dll
Version: 3.x.y.z

Syntax

C#
public abstract CreateCustomActionTypeResponse CreateCustomActionType(
         CreateCustomActionTypeRequest request
)
Parameters
request
Type: Amazon.CodePipeline.Model.CreateCustomActionTypeRequest

Container for the necessary parameters to execute the CreateCustomActionType service method.

Return Value
The response from the CreateCustomActionType service method, as returned by CodePipeline.

Exceptions

ExceptionCondition
LimitExceededException The number of pipelines associated with the AWS account has exceeded the limit allowed for the account.
ValidationException The validation was specified in an invalid format.

Examples

This example creates a build custom action for AWS CodePipeline for a Jenkins build project. For more information about the requirements for creating a custom action, including the structure of the JSON file commonly used to help create custom actions, see Create a Custom Action in the AWS CodePipeline User Guide. For a walkthrough of creating a custom action in a pipeline, follow the Four-Stage Pipeline Tutorial.

Create a custom action


var response = client.CreateCustomActionType(new CreateCustomActionTypeRequest 
{
    Version = "1", // A new custom action always has a version of 1. This is required.
    Category = "Build",
    ConfigurationProperties = new List {
        new ActionConfigurationProperty {
            Name = "MyJenkinsExampleBuildProject",
            Type = "String",
            Required = true,
            Key = true,
            Description = "The name of the build project must be provided when this action is added to the pipeline.",
            Queryable = false,
            Secret = false
        }
    }, // The text in description will be displayed to your users, and can contain a maximum of 2048 characters. The value for name in configurationProperties is the name of the project, if any.  In this example, this is the name of the build project on the Jenkins server
    InputArtifactDetails = new ArtifactDetails {
        MaximumCount = 1,
        MinimumCount = 0
    }, // This is the minimum and maximum number of artifacts allowed as inputs for the action. For more information about input and output artifacts, see Pipeline Structure Reference in the AWS CodePipeline User Guide.
    OutputArtifactDetails = new ArtifactDetails {
        MaximumCount = 1,
        MinimumCount = 0
    }, // This is the minimum and maximum number of artifacts allowed as outputs for the action. For more information about input and output artifacts, see Pipeline Structure Reference in the AWS CodePipeline User Guide.
    Provider = "MyBuild-ProviderName", // In this example, this is the name given to the provider field when configuring the AWS CodePipeline Plugin for Jenkins. For more information, see the Four-Stage Pipeline Tutorial in the AWS CodePipeline User Guide.
    Settings = new ActionTypeSettings {
        EntityUrlTemplate = "https://192.0.2.4/job/{Config:ProjectName}/",
        ExecutionUrlTemplate = "https://192.0.2.4/job/{Config:ProjectName}/lastSuccessfulBuild/{ExternalExecutionId}/",
        RevisionUrlTemplate = "none"
    } // entityUrlTemplate is the static link that provides information about the service provider for the action. In the example, the build system includes a static link to the Jenkins build project at the specific server address.  Similarly, executionUrlTemplate is the dynamic link that will be updated with information about the current or most recent run of the action.
});

ActionType actionType = response.ActionType;

            

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

See Also