// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
using System.Text.Json.Serialization;
namespace AWS.Deploy.Recipes.CDK.Common
{
///
/// A representation of the settings transferred from the AWS .NET deployment tool to the CDK project.
///
///
public interface IRecipeProps
{
///
/// The name of the CloudFormation stack
///
string StackName { get; set; }
///
/// The path to the .NET project to deploy to AWS.
///
string ProjectPath { get; set; }
///
/// The ECR Repository Name where the docker image will be pushed to.
///
string? ECRRepositoryName { get; set; }
///
/// The ECR Image Tag of the docker image.
///
string? ECRImageTag { get; set; }
///
/// The path of the zip file containing the assemblies produced by the dotnet publish command.
///
string? DotnetPublishZipPath { get; set; }
///
/// The directory containing the assemblies produced by the dotnet publish command.
///
string? DotnetPublishOutputDirectory { get; set; }
///
/// The ID of the recipe being used to deploy the application.
///
string RecipeId { get; set; }
///
/// The version of the recipe being used to deploy the application.
///
string RecipeVersion { get; set; }
///
/// The configured settings made by the frontend. These are recipe specific and defined in the recipe's definition.
///
T Settings { get; set; }
///
/// These option settings are part of the deployment bundle definition
///
string? DeploymentBundleSettings { get; set; }
///
/// The Region used during deployment.
///
string? AWSRegion { get; set; }
///
/// The account ID used during deployment.
///
string? AWSAccountId { get; set; }
}
///
/// A representation of the settings transferred from the AWS .NET deployment tool to the CDK project.
///
///
public class RecipeProps : IRecipeProps
{
///
/// The name of the CloudFormation stack
///
public string StackName { get; set; }
///
/// The path to the .NET project to deploy to AWS.
///
public string ProjectPath { get; set; }
///
/// The ECR Repository Name where the docker image will be pushed to.
///
public string? ECRRepositoryName { get; set; }
///
/// The ECR Image Tag of the docker image.
///
public string? ECRImageTag { get; set; }
///
/// The path of the zip file containing the assemblies produced by the dotnet publish command.
///
public string? DotnetPublishZipPath { get; set; }
///
/// The directory containing the assemblies produced by the dotnet publish command.
///
public string? DotnetPublishOutputDirectory { get; set; }
///
/// The ID of the recipe being used to deploy the application.
///
public string RecipeId { get; set; }
///
/// The version of the recipe being used to deploy the application.
///
public string RecipeVersion { get; set; }
///
/// The configured settings made by the frontend. These are recipe specific and defined in the recipe's definition.
///
public T Settings { get; set; }
///
/// These option settings are part of the deployment bundle definition
///
public string? DeploymentBundleSettings { get; set; }
///
/// The Region used during deployment.
///
public string? AWSRegion { get; set; }
///
/// The account ID used during deployment.
///
public string? AWSAccountId { get; set; }
/// A parameterless constructor is needed for
/// or the classes will fail to initialize.
/// The warnings are disabled since a parameterless constructor will allow non-nullable properties to be initialized with null values.
#nullable disable warnings
public RecipeProps()
{
}
#nullable restore warnings
public RecipeProps(string stackName, string projectPath, string recipeId, string recipeVersion,
string? awsAccountId, string? awsRegion, T settings)
{
StackName = stackName;
ProjectPath = projectPath;
RecipeId = recipeId;
RecipeVersion = recipeVersion;
AWSAccountId = awsAccountId;
AWSRegion = awsRegion;
Settings = settings;
}
}
}