diff --git a/.autover/changes/07AEC2AC-0C7B-4C60-9EAF-C92E6A805559.json b/.autover/changes/07AEC2AC-0C7B-4C60-9EAF-C92E6A805559.json new file mode 100644 index 00000000..e9e3c079 --- /dev/null +++ b/.autover/changes/07AEC2AC-0C7B-4C60-9EAF-C92E6A805559.json @@ -0,0 +1,13 @@ +{ + "Projects": [ + { + "Name": "AWS.Deploy.CLI", + "Type": "Minor", + "ChangelogMessages": [ + "Added support for .NET 9 in deployment recipes.", + "Added ability to configure EC2 IMDSv1 access for the Windows and Linux Elastic Beanstalk recipes.", + "Support Elastic Beanstalk's transition to using EC2 Launch Templates from the deprecated Launch Configuration." + ] + } + ] +} \ No newline at end of file diff --git a/site/content/docs/cicd/recipes/ASP.NET Core App to AWS Elastic Beanstalk on Linux.md b/site/content/docs/cicd/recipes/ASP.NET Core App to AWS Elastic Beanstalk on Linux.md index 2edfb802..6b2dd681 100644 --- a/site/content/docs/cicd/recipes/ASP.NET Core App to AWS Elastic Beanstalk on Linux.md +++ b/site/content/docs/cicd/recipes/ASP.NET Core App to AWS Elastic Beanstalk on Linux.md @@ -34,6 +34,10 @@ * ID: InstanceType * Description: The EC2 instance type of the EC2 instances created for the environment. * Type: String +* **Access to IMDS v1** + * ID: IMDSv1Access + * Description: Access to IMDS v1; Default means new deployments will disable IMDSv1, redeployments leave the setting at its current value. + * Type: String * **Environment Type** * ID: EnvironmentType * Description: The type of environment to create; for example, a single instance for development work or load balanced for production. diff --git a/site/content/docs/cicd/recipes/ASP.NET Core App to AWS Elastic Beanstalk on Windows.md b/site/content/docs/cicd/recipes/ASP.NET Core App to AWS Elastic Beanstalk on Windows.md index 4c60763f..aba416f5 100644 --- a/site/content/docs/cicd/recipes/ASP.NET Core App to AWS Elastic Beanstalk on Windows.md +++ b/site/content/docs/cicd/recipes/ASP.NET Core App to AWS Elastic Beanstalk on Windows.md @@ -29,6 +29,10 @@ * ID: InstanceType * Description: The EC2 instance type of the EC2 instances created for the environment. * Type: String +* **Access to IMDS v1** + * ID: IMDSv1Access + * Description: Access to IMDS v1; Default means new deployments will disable IMDSv1, redeployments leave the setting at its current value. + * Type: String * **Environment Type** * ID: EnvironmentType * Description: The type of environment to create; for example, a single instance for development work or load balanced for production. diff --git a/src/AWS.Deploy.DockerEngine/Properties/DockerFileConfig.json b/src/AWS.Deploy.DockerEngine/Properties/DockerFileConfig.json index 122d06c3..3c0cadf6 100644 --- a/src/AWS.Deploy.DockerEngine/Properties/DockerFileConfig.json +++ b/src/AWS.Deploy.DockerEngine/Properties/DockerFileConfig.json @@ -2,11 +2,17 @@ { "SdkType": "Microsoft.NET.Sdk.Web", "ImageMapping": [ + { + "TargetFramework": "net9.0", + "BaseImage": "mcr.microsoft.com/dotnet/aspnet:9.0", + "BuildImage": "mcr.microsoft.com/dotnet/sdk:9.0" + }, { "TargetFramework": "net8.0", "BaseImage": "mcr.microsoft.com/dotnet/aspnet:8.0", "BuildImage": "mcr.microsoft.com/dotnet/sdk:8.0" - }, { + }, + { "TargetFramework": "net7.0", "BaseImage": "mcr.microsoft.com/dotnet/aspnet:7.0", "BuildImage": "mcr.microsoft.com/dotnet/sdk:7.0" @@ -31,11 +37,16 @@ { "SdkType": "Microsoft.NET.Sdk", "ImageMapping": [ + { + "TargetFramework": "net9.0", + "BaseImage": "mcr.microsoft.com/dotnet/runtime:9.0", + "BuildImage": "mcr.microsoft.com/dotnet/sdk:9.0" + }, { "TargetFramework": "net8.0", "BaseImage": "mcr.microsoft.com/dotnet/runtime:8.0", "BuildImage": "mcr.microsoft.com/dotnet/sdk:8.0" - }, + }, { "TargetFramework": "net7.0", "BaseImage": "mcr.microsoft.com/dotnet/runtime:7.0", diff --git a/src/AWS.Deploy.Orchestration/CdkAppSettingsSerializer.cs b/src/AWS.Deploy.Orchestration/CdkAppSettingsSerializer.cs index 98454fe3..6bf05cb0 100644 --- a/src/AWS.Deploy.Orchestration/CdkAppSettingsSerializer.cs +++ b/src/AWS.Deploy.Orchestration/CdkAppSettingsSerializer.cs @@ -53,7 +53,8 @@ public string Build(CloudApplication cloudApplication, Recommendation recommenda ECRRepositoryName = recommendation.DeploymentBundle.ECRRepositoryName ?? "", ECRImageTag = recommendation.DeploymentBundle.ECRImageTag ?? "", DotnetPublishZipPath = recommendation.DeploymentBundle.DotnetPublishZipPath ?? "", - DotnetPublishOutputDirectory = recommendation.DeploymentBundle.DotnetPublishOutputDirectory ?? "" + DotnetPublishOutputDirectory = recommendation.DeploymentBundle.DotnetPublishOutputDirectory ?? "", + NewDeployment = !recommendation.IsExistingCloudApplication }; // Persist deployment bundle settings diff --git a/src/AWS.Deploy.Orchestration/DeploymentBundleHandler.cs b/src/AWS.Deploy.Orchestration/DeploymentBundleHandler.cs index 237548de..ed3fc456 100644 --- a/src/AWS.Deploy.Orchestration/DeploymentBundleHandler.cs +++ b/src/AWS.Deploy.Orchestration/DeploymentBundleHandler.cs @@ -133,9 +133,9 @@ private void SwitchToSelfContainedBuildIfNeeded(Recommendation recommendation) if (string.IsNullOrEmpty(targetFramework)) return; - // Elastic Beanstalk doesn't currently have .NET 7 preinstalled. - var unavailableFramework = new List { "net7.0" }; - var frameworkNames = new Dictionary { { "net7.0", ".NET 7" } }; + // Elastic Beanstalk doesn't currently have .NET 7 and 9 preinstalled. + var unavailableFramework = new List { "net7.0", "net9.0" }; + var frameworkNames = new Dictionary { { "net7.0", ".NET 7" }, { "net9.0", ".NET 9" } }; if (unavailableFramework.Contains(targetFramework)) { _interactiveService.LogInfoMessage($"Using self-contained publish since AWS Elastic Beanstalk does not currently have {frameworkNames[targetFramework]} preinstalled"); diff --git a/src/AWS.Deploy.Recipes.CDK.Common/AWS.Deploy.Recipes.CDK.Common.csproj b/src/AWS.Deploy.Recipes.CDK.Common/AWS.Deploy.Recipes.CDK.Common.csproj index b085004d..9250a4a4 100644 --- a/src/AWS.Deploy.Recipes.CDK.Common/AWS.Deploy.Recipes.CDK.Common.csproj +++ b/src/AWS.Deploy.Recipes.CDK.Common/AWS.Deploy.Recipes.CDK.Common.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/AWS.Deploy.Recipes.CDK.Common/RecipeProps.cs b/src/AWS.Deploy.Recipes.CDK.Common/RecipeProps.cs index 76f4c0d3..1dabc5a2 100644 --- a/src/AWS.Deploy.Recipes.CDK.Common/RecipeProps.cs +++ b/src/AWS.Deploy.Recipes.CDK.Common/RecipeProps.cs @@ -70,6 +70,11 @@ public interface IRecipeProps /// The account ID used during deployment. /// string? AWSAccountId { get; set; } + + /// + /// True if the recipe is doing a new deployment. + /// + bool NewDeployment { get; set; } } /// @@ -138,6 +143,11 @@ public class RecipeProps : IRecipeProps /// public string? AWSAccountId { get; set; } + /// + /// True if the recipe is doing a redeployment. + /// + public bool NewDeployment { get; set; } = false; + /// 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. diff --git a/src/AWS.Deploy.Recipes/CdkTemplates/AspNetAppAppRunner/AspNetAppAppRunner.csproj b/src/AWS.Deploy.Recipes/CdkTemplates/AspNetAppAppRunner/AspNetAppAppRunner.csproj index 6293b380..a50c9a84 100644 --- a/src/AWS.Deploy.Recipes/CdkTemplates/AspNetAppAppRunner/AspNetAppAppRunner.csproj +++ b/src/AWS.Deploy.Recipes/CdkTemplates/AspNetAppAppRunner/AspNetAppAppRunner.csproj @@ -25,7 +25,7 @@ - + - + - + - + - +