Skip to content

Commit

Permalink
Merge pull request #355 from aws/dev
Browse files Browse the repository at this point in the history
chore: release 0.22
  • Loading branch information
philasmar authored Oct 8, 2021
2 parents 9a4d9d2 + 24c8dff commit 2ae77eb
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 28 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/codebuild-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: AWS CodeBuild CI

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ private List<OptionSettingItemSummary> 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)
Expand Down Expand Up @@ -263,7 +264,7 @@ public async Task<IActionResult> GetExistingDeployments(string sessionId)

var deployedApplicationQueryer = serviceProvider.GetRequiredService<IDeployedApplicationQueryer>();
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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> AllowedValues { get; set; } = new List<string>();

Expand Down
24 changes: 21 additions & 3 deletions src/AWS.Deploy.Recipes/CdkTemplates/BlazorWasm/Generated/Recipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Configuration> 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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"ServicePrincipal": "tasks.apprunner.amazonaws.com"
},
"AdvancedSetting": false,
"Updatable": false,
"Updatable": true,
"ChildOptionSettings": [
{
"Id": "CreateNew",
Expand All @@ -101,15 +101,15 @@
"Type": "Bool",
"DefaultValue": true,
"AdvancedSetting": false,
"Updatable": false
"Updatable": true
},
{
"Id": "RoleArn",
"Name": "Existing Role ARN",
"Description": "The ARN of the existing role to use.",
"Type": "String",
"AdvancedSetting": false,
"Updatable": false,
"Updatable": true,
"DependsOn": [
{
"Id": "ApplicationIAMRole.CreateNew",
Expand All @@ -129,7 +129,7 @@
"ServicePrincipal": "build.apprunner.amazonaws.com"
},
"AdvancedSetting": true,
"Updatable": false,
"Updatable": true,
"ChildOptionSettings": [
{
"Id": "CreateNew",
Expand All @@ -138,15 +138,15 @@
"Type": "Bool",
"DefaultValue": true,
"AdvancedSetting": false,
"Updatable": false
"Updatable": true
},
{
"Id": "RoleArn",
"Name": "Existing Role ARN",
"Description": "The ARN of the existing role to use.",
"Type": "String",
"AdvancedSetting": false,
"Updatable": false,
"Updatable": true,
"DependsOn": [
{
"Id": "ServiceAccessIAMRole.CreateNew",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@
"Type": "Bool",
"DefaultValue": true,
"AdvancedSetting": false,
"Updatable": false
"Updatable": true
},
{
"Id": "RoleArn",
"Name": "Existing Role ARN",
"Description": "The ARN of the existing role to use.",
"Type": "String",
"AdvancedSetting": false,
"Updatable": false,
"Updatable": true,
"Validators": [
{
"ValidatorType": "Regex",
Expand Down
4 changes: 2 additions & 2 deletions src/AWS.Deploy.Recipes/RecipeDefinitions/BlazorWasm.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"ServicePrincipal": "ecs-tasks.amazonaws.com"
},
"AdvancedSetting": false,
"Updatable": false,
"Updatable": true,
"ChildOptionSettings": [
{
"Id": "CreateNew",
Expand All @@ -184,19 +184,19 @@
"Type": "Bool",
"DefaultValue": true,
"AdvancedSetting": false,
"Updatable": false
"Updatable": true
},
{
"Id": "RoleArn",
"Name": "Existing Role ARN",
"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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"ServicePrincipal": "ecs-tasks.amazonaws.com"
},
"AdvancedSetting": false,
"Updatable": false,
"Updatable": true,
"ChildOptionSettings": [
{
"Id": "CreateNew",
Expand All @@ -222,15 +222,15 @@
"Type": "Bool",
"DefaultValue": true,
"AdvancedSetting": false,
"Updatable": false
"Updatable": true
},
{
"Id": "RoleArn",
"Name": "Existing Role ARN",
"Description": "The ARN of the existing role to use.",
"Type": "String",
"AdvancedSetting": false,
"Updatable": false,
"Updatable": true,
"Validators": [
{
"ValidatorType": "Regex",
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -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": [
".*"
],
Expand Down

0 comments on commit 2ae77eb

Please sign in to comment.