diff --git a/.github/workflows/codebuild-ci.yml b/.github/workflows/codebuild-ci.yml index 298563c5e..75e2f0eec 100644 --- a/.github/workflows/codebuild-ci.yml +++ b/.github/workflows/codebuild-ci.yml @@ -1,10 +1,6 @@ name: AWS CodeBuild CI on: - push: - branches: - - main - - dev pull_request: branches: - main diff --git a/src/AWS.Deploy.CLI/ServerMode/Controllers/DeploymentController.cs b/src/AWS.Deploy.CLI/ServerMode/Controllers/DeploymentController.cs index e79d42727..4905a3cab 100644 --- a/src/AWS.Deploy.CLI/ServerMode/Controllers/DeploymentController.cs +++ b/src/AWS.Deploy.CLI/ServerMode/Controllers/DeploymentController.cs @@ -185,7 +185,8 @@ private List ListOptionSettingSummary(Recommendation r TypeHint = setting.TypeHint?.ToString(), Value = recommendation.GetOptionSettingValue(setting), Advanced = setting.AdvancedSetting, - Updatable = (!recommendation.IsExistingCloudApplication || setting.Updatable) && recommendation.IsOptionSettingDisplayable(setting), + ReadOnly = recommendation.IsExistingCloudApplication && !setting.Updatable, + Visible = recommendation.IsOptionSettingDisplayable(setting), AllowedValues = setting.AllowedValues, ValueMapping = setting.ValueMapping, ChildOptionSettings = ListOptionSettingSummary(recommendation, setting.ChildOptionSettings) @@ -263,7 +264,7 @@ public async Task GetExistingDeployments(string sessionId) var deployedApplicationQueryer = serviceProvider.GetRequiredService(); var session = CreateOrchestratorSession(state); - + //ExistingDeployments is set during StartDeploymentSession API. It is only updated here if ExistingDeployments was null. state.ExistingDeployments ??= await deployedApplicationQueryer.GetCompatibleApplications(state.NewRecommendations.ToList(), session: session); diff --git a/src/AWS.Deploy.CLI/ServerMode/Models/OptionSettingItemSummary.cs b/src/AWS.Deploy.CLI/ServerMode/Models/OptionSettingItemSummary.cs index efc974fff..240a5ac58 100644 --- a/src/AWS.Deploy.CLI/ServerMode/Models/OptionSettingItemSummary.cs +++ b/src/AWS.Deploy.CLI/ServerMode/Models/OptionSettingItemSummary.cs @@ -22,7 +22,9 @@ public class OptionSettingItemSummary public bool Advanced { get; set; } - public bool Updatable { get; set; } + public bool ReadOnly { get; set; } + + public bool Visible { get; set; } public IList AllowedValues { get; set; } = new List(); diff --git a/src/AWS.Deploy.Recipes/CdkTemplates/BlazorWasm/Generated/Recipe.cs b/src/AWS.Deploy.Recipes/CdkTemplates/BlazorWasm/Generated/Recipe.cs index cd19a3c2f..7391fa622 100644 --- a/src/AWS.Deploy.Recipes/CdkTemplates/BlazorWasm/Generated/Recipe.cs +++ b/src/AWS.Deploy.Recipes/CdkTemplates/BlazorWasm/Generated/Recipe.cs @@ -33,6 +33,10 @@ public class Recipe : Construct public string AccessLoggingBucket { get; } = "AccessLoggingBucket"; + public string BackendRestApiHttpOrigin { get; } = "BackendRestApiHttpOrigin"; + + public string BackendRestApiCacheBehavior { get; } = "BackendRestApiCacheBehavior"; + public Recipe(Construct scope, IRecipeProps props) // The "Recipe" construct ID will be used as part of the CloudFormation logical ID. If the value is changed this will // change the expected values for the "DisplayedResources" in the corresponding recipe file. @@ -161,10 +165,24 @@ private void ConfigureCloudFrontDistribution(Configuration settings) { var backendApiUri = new Uri(settings.BackendApi.Uri); - var httpOrigin = new HttpOrigin(backendApiUri.Host, new HttpOriginProps + + var httpOriginProps = new HttpOriginProps { OriginPath = backendApiUri.PathAndQuery - }); + }; + + if (string.Equals("https", backendApiUri.Scheme, StringComparison.OrdinalIgnoreCase)) + { + httpOriginProps.ProtocolPolicy = OriginProtocolPolicy.HTTPS_ONLY; + httpOriginProps.HttpsPort = backendApiUri.Port; + } + else + { + httpOriginProps.ProtocolPolicy = OriginProtocolPolicy.HTTP_ONLY; + httpOriginProps.HttpPort = backendApiUri.Port; + } + + var httpOrigin = new HttpOrigin(backendApiUri.Host, InvokeCustomizeCDKPropsEvent(nameof(BackendRestApiHttpOrigin), this, httpOriginProps)); // Since this is a backend API where the business logic for the Blazor app caching must be disabled. var addBehavorOptions = new AddBehaviorOptions @@ -173,7 +191,7 @@ private void ConfigureCloudFrontDistribution(Configuration settings) CachePolicy = CachePolicy.CACHING_DISABLED }; - CloudFrontDistribution.AddBehavior(settings.BackendApi.ResourcePathPattern, httpOrigin, addBehavorOptions); + CloudFrontDistribution.AddBehavior(settings.BackendApi.ResourcePathPattern, httpOrigin, InvokeCustomizeCDKPropsEvent(nameof(BackendRestApiCacheBehavior), this, addBehavorOptions)); } new CfnOutput(this, "EndpointURL", new CfnOutputProps diff --git a/src/AWS.Deploy.Recipes/RecipeDefinitions/ASP.NETAppAppRunner.recipe b/src/AWS.Deploy.Recipes/RecipeDefinitions/ASP.NETAppAppRunner.recipe index 5ea9e8775..ea6c09692 100644 --- a/src/AWS.Deploy.Recipes/RecipeDefinitions/ASP.NETAppAppRunner.recipe +++ b/src/AWS.Deploy.Recipes/RecipeDefinitions/ASP.NETAppAppRunner.recipe @@ -92,7 +92,7 @@ "ServicePrincipal": "tasks.apprunner.amazonaws.com" }, "AdvancedSetting": false, - "Updatable": false, + "Updatable": true, "ChildOptionSettings": [ { "Id": "CreateNew", @@ -101,7 +101,7 @@ "Type": "Bool", "DefaultValue": true, "AdvancedSetting": false, - "Updatable": false + "Updatable": true }, { "Id": "RoleArn", @@ -109,7 +109,7 @@ "Description": "The ARN of the existing role to use.", "Type": "String", "AdvancedSetting": false, - "Updatable": false, + "Updatable": true, "DependsOn": [ { "Id": "ApplicationIAMRole.CreateNew", @@ -129,7 +129,7 @@ "ServicePrincipal": "build.apprunner.amazonaws.com" }, "AdvancedSetting": true, - "Updatable": false, + "Updatable": true, "ChildOptionSettings": [ { "Id": "CreateNew", @@ -138,7 +138,7 @@ "Type": "Bool", "DefaultValue": true, "AdvancedSetting": false, - "Updatable": false + "Updatable": true }, { "Id": "RoleArn", @@ -146,7 +146,7 @@ "Description": "The ARN of the existing role to use.", "Type": "String", "AdvancedSetting": false, - "Updatable": false, + "Updatable": true, "DependsOn": [ { "Id": "ServiceAccessIAMRole.CreateNew", diff --git a/src/AWS.Deploy.Recipes/RecipeDefinitions/ASP.NETAppECSFargate.recipe b/src/AWS.Deploy.Recipes/RecipeDefinitions/ASP.NETAppECSFargate.recipe index 9da29bf12..e26be9b28 100644 --- a/src/AWS.Deploy.Recipes/RecipeDefinitions/ASP.NETAppECSFargate.recipe +++ b/src/AWS.Deploy.Recipes/RecipeDefinitions/ASP.NETAppECSFargate.recipe @@ -195,7 +195,7 @@ "Type": "Bool", "DefaultValue": true, "AdvancedSetting": false, - "Updatable": false + "Updatable": true }, { "Id": "RoleArn", @@ -203,7 +203,7 @@ "Description": "The ARN of the existing role to use.", "Type": "String", "AdvancedSetting": false, - "Updatable": false, + "Updatable": true, "Validators": [ { "ValidatorType": "Regex", diff --git a/src/AWS.Deploy.Recipes/RecipeDefinitions/BlazorWasm.recipe b/src/AWS.Deploy.Recipes/RecipeDefinitions/BlazorWasm.recipe index a4df8ed4d..9425baca2 100644 --- a/src/AWS.Deploy.Recipes/RecipeDefinitions/BlazorWasm.recipe +++ b/src/AWS.Deploy.Recipes/RecipeDefinitions/BlazorWasm.recipe @@ -7,8 +7,8 @@ "DeploymentBundle": "DotnetPublishZipFile", "CdkProjectTemplate": "../CdkTemplates/BlazorWasm", "CdkProjectTemplateId": "netdeploy.BlazorWasm", - "Description": "This Blazor WebAssembly application will be built and hosted in the new Amazon Simple Storage Service (Amazon S3) bucket. The created Amazon S3 bucket will be configured for web hosting and open to the public with read access.", - "ShortDescription": "Blazor WebAssembly application hosted in an Amazon S3 bucket.", + "Description": "This Blazor WebAssembly application will be built and deployed to a new Amazon Simple Storage Service (Amazon S3) bucket. The Blazor applications will be exposed publicly through a CloudFront distribution using the S3 bucket as the origin.", + "ShortDescription": "Blazor WebAssembly application deployed in an Amazon S3 bucket and CloudFront.", "TargetService": "Amazon S3", "DisplayedResources": [ diff --git a/src/AWS.Deploy.Recipes/RecipeDefinitions/ConsoleAppECSFargateScheduleTask.recipe b/src/AWS.Deploy.Recipes/RecipeDefinitions/ConsoleAppECSFargateScheduleTask.recipe index af6696556..4975447cf 100644 --- a/src/AWS.Deploy.Recipes/RecipeDefinitions/ConsoleAppECSFargateScheduleTask.recipe +++ b/src/AWS.Deploy.Recipes/RecipeDefinitions/ConsoleAppECSFargateScheduleTask.recipe @@ -175,7 +175,7 @@ "ServicePrincipal": "ecs-tasks.amazonaws.com" }, "AdvancedSetting": false, - "Updatable": false, + "Updatable": true, "ChildOptionSettings": [ { "Id": "CreateNew", @@ -184,7 +184,7 @@ "Type": "Bool", "DefaultValue": true, "AdvancedSetting": false, - "Updatable": false + "Updatable": true }, { "Id": "RoleArn", @@ -192,11 +192,11 @@ "Description": "The ARN of the existing role to use.", "Type": "String", "AdvancedSetting": false, - "Updatable": false, + "Updatable": true, "Validators": [ { "ValidatorType": "Regex", - "Configuration" : { + "Configuration": { "Regex": "arn:.+:iam::[0-9]{12}:.+", "AllowEmptyString": true, "ValidationFailedMessage": "Invalid IAM Role ARN. The ARN should contain the arn:[PARTITION]:iam namespace, followed by the account ID, and then the resource path. For example - arn:aws:iam::123456789012:role/S3Access is a valid IAM Role ARN. For more information visit https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns" diff --git a/src/AWS.Deploy.Recipes/RecipeDefinitions/ConsoleAppECSFargateService.recipe b/src/AWS.Deploy.Recipes/RecipeDefinitions/ConsoleAppECSFargateService.recipe index fd6f75f29..1a94d8d39 100644 --- a/src/AWS.Deploy.Recipes/RecipeDefinitions/ConsoleAppECSFargateService.recipe +++ b/src/AWS.Deploy.Recipes/RecipeDefinitions/ConsoleAppECSFargateService.recipe @@ -213,7 +213,7 @@ "ServicePrincipal": "ecs-tasks.amazonaws.com" }, "AdvancedSetting": false, - "Updatable": false, + "Updatable": true, "ChildOptionSettings": [ { "Id": "CreateNew", @@ -222,7 +222,7 @@ "Type": "Bool", "DefaultValue": true, "AdvancedSetting": false, - "Updatable": false + "Updatable": true }, { "Id": "RoleArn", @@ -230,7 +230,7 @@ "Description": "The ARN of the existing role to use.", "Type": "String", "AdvancedSetting": false, - "Updatable": false, + "Updatable": true, "Validators": [ { "ValidatorType": "Regex", diff --git a/version.json b/version.json index fde578e20..68ecae5f4 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.21", + "version": "0.22", "publicReleaseRefSpec": [ ".*" ],