Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b97fd81
Initial AWS CDK Support
Apr 12, 2024
a3ecee3
Add documentation and additional resources
Apr 30, 2024
6164785
Make properties optional
Apr 30, 2024
77d56cb
Add Amazon Kinesis streams
May 1, 2024
306e022
Merge branch 'main' into vlesierse/aws-cdk
May 8, 2024
756fea0
Add bucket notifications and topic subscriptions
May 8, 2024
be9136a
Adding this for extension methods
May 8, 2024
925b358
Fix await stack resource
vlesierse May 15, 2024
6120522
Allow multiple reference to same construct resource
vlesierse May 15, 2024
953c11e
Merge branch 'main' into vlesierse/aws-cdk
vlesierse May 22, 2024
e74cbf0
Refactoring after code review
May 29, 2024
f54ee37
Cleanup
May 29, 2024
4063577
Changes after code review
May 30, 2024
c606bb3
Provide guidance for missing CDK bootstrap
Jun 10, 2024
4cf0b37
Merge AWSCDK in AWS playground
Jun 11, 2024
4b6ae98
Merge branch 'main' into vlesierse/aws-cdk
Jun 12, 2024
98feb7e
Merge branch 'main' into vlesierse/aws-cdk
Jun 13, 2024
6ff3a61
Changes after code review
Jun 13, 2024
9668b80
Remove support restrictions
Jun 13, 2024
38433e6
Simplified construct/stack outputs
Jun 13, 2024
e691101
Include output changes
Jun 13, 2024
2b25719
Introduce new provisioners
Jun 19, 2024
9f71622
CloudFormation provisioners
vlesierse Jun 20, 2024
2a4d1e9
Refactor CloudFormation executor
Jun 20, 2024
77ef4ec
Add AWS CDK Provisioning
vlesierse Jun 21, 2024
e7e50d5
Change manifest to include the right stack name
vlesierse Jun 21, 2024
bc5daa1
Fix manifest values
vlesierse Jun 21, 2024
6850b46
Support dev environments with spaces
vlesierse Jun 21, 2024
29cebe5
Add tests for CDK resources
Jun 21, 2024
95f55af
Add CDK documentation to README.md
Jun 21, 2024
9329a9c
Changes after code review
Jun 23, 2024
821a6cf
Changes after code review
Jul 5, 2024
910e762
Additional changes after code review
Jul 5, 2024
dd45fb9
Refactor and simplify CDK stack provisioning
Jul 6, 2024
98e94ba
Merge branch 'main' into vlesierse/aws-cdk
Jul 7, 2024
6ce231a
Remove AWSSDK SSO
Jul 7, 2024
4e9338a
Fix build
Jul 8, 2024
04f0571
Merge branch 'main' into vlesierse/aws-cdk
Jul 24, 2024
1dadf75
Changes after code review
Aug 24, 2024
8c961ec
Merge branch 'main' into vlesierse/aws-cdk
vlesierse Aug 24, 2024
2667b19
Add missing merge changes
vlesierse Aug 24, 2024
a92f4fb
Fix AWSCloudFormationResourceTests
vlesierse Aug 24, 2024
04b1b3c
Remove Aspire- prefix from AddAWSCloudFormationStack
vlesierse Aug 24, 2024
3d6a837
Fix packages due to merge
vlesierse Aug 24, 2024
bb12ea2
Bump AWS CDK
vlesierse Aug 24, 2024
54117f3
Temp solution to verify build
Aug 26, 2024
14dbaa6
Remove namespace for doc reference
vlesierse Aug 31, 2024
2c91248
Ignore construct resource in manifest
vlesierse Sep 2, 2024
a2f2b55
Merge branch 'main' into vlesierse/aws-cdk
Sep 4, 2024
ddaaf90
Bump AWS CDK version & rename annotation
vlesierse Sep 10, 2024
9255fba
Merge branch 'main' into vlesierse/aws-cdk
vlesierse Sep 10, 2024
a62a0bb
Remove nuget.org from config
vlesierse Sep 10, 2024
2ab7de8
Merge branch 'main' into vlesierse/aws-cdk
Sep 12, 2024
f5fee89
Merge branch 'main' into vlesierse/aws-cdk
Sep 13, 2024
a125889
Bump AWS CDK to 2.158.0
Sep 13, 2024
1bbd536
Add RequiresTools to AWSCDK tests
Sep 13, 2024
5caa3a3
Mark active issue 4508
Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlServerEndToEnd.Common",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlServerEndToEnd.DbSetup", "playground\SqlServerEndToEnd\SqlServerEndToEnd.DbSetup\SqlServerEndToEnd.DbSetup.csproj", "{125C081D-7E5B-4F35-B5CD-E2B56140380F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWSCDK.AppHost", "playground\AWS\AWSCDK.AppHost\AWSCDK.AppHost.csproj", "{B5826732-7318-4179-9B85-870CB18AC533}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1602,6 +1604,10 @@ Global
{125C081D-7E5B-4F35-B5CD-E2B56140380F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{125C081D-7E5B-4F35-B5CD-E2B56140380F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{125C081D-7E5B-4F35-B5CD-E2B56140380F}.Release|Any CPU.Build.0 = Release|Any CPU
{B5826732-7318-4179-9B85-870CB18AC533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5826732-7318-4179-9B85-870CB18AC533}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5826732-7318-4179-9B85-870CB18AC533}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5826732-7318-4179-9B85-870CB18AC533}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1895,6 +1901,7 @@ Global
{F0C976EF-EE26-4EA9-B324-0CD21DCEA140} = {3FF3F00C-95C0-46FC-B2BE-A3920C71E393}
{1997067D-8EF2-43B3-AB13-9B2E12B52709} = {2CA6AB88-21EF-4488-BB1B-3A5BAD5FE2AD}
{125C081D-7E5B-4F35-B5CD-E2B56140380F} = {2CA6AB88-21EF-4488-BB1B-3A5BAD5FE2AD}
{B5826732-7318-4179-9B85-870CB18AC533} = {EF91843F-C4AB-47F8-909B-C494EABB2BA2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C}
Expand Down
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<PackageVersion Include="AWS.Messaging" Version="0.9.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AWS" Version="1.1.0-beta.5" />
<PackageVersion Include="OpenTelemetry.Extensions.AWS" Version="1.3.0-beta.1" />
<!-- AWS CDK dependencies -->
<PackageVersion Include="Amazon.CDK.Lib" Version="2.158.0" />
<!-- Azure SDK for .NET dependencies -->
<PackageVersion Include="Azure.AI.OpenAI" Version="2.0.0-beta.2" />
<PackageVersion Include="Azure.Data.Tables" Version="12.9.0" />
Expand Down
1 change: 1 addition & 0 deletions playground/AWS/AWS.AppHost/AWS.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
<NoWarn>$(NoWarn);CS8002</NoWarn> <!-- AWS CDK packages are not signed -->
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions playground/AWS/AWSCDK.AppHost/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# AWS CDK
cdk.out
23 changes: 23 additions & 0 deletions playground/AWS/AWSCDK.AppHost/AWSCDK.AppHost.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
<NoWarn>$(NoWarn);CS8002</NoWarn> <!-- AWS CDK packages are not signed -->
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\KnownResourceNames.cs" Link="KnownResourceNames.cs" />
</ItemGroup>

<ItemGroup>
<AspireProjectOrPackageReference Include="Aspire.Hosting.AWS" />
<AspireProjectOrPackageReference Include="Aspire.Hosting.AppHost" />

<ProjectReference Include="..\Frontend\Frontend.csproj" />
</ItemGroup>

</Project>
21 changes: 21 additions & 0 deletions playground/AWS/AWSCDK.AppHost/CustomStack.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Amazon.CDK;
using Amazon.CDK.AWS.S3;
using Constructs;

namespace AWSCDK.AppHost;

public class CustomStack : Stack
{

public IBucket Bucket { get; }

public CustomStack(Construct scope, string id)
: base(scope, id)
{
Bucket = new Bucket(this, "Bucket");
}

}
24 changes: 24 additions & 0 deletions playground/AWS/AWSCDK.AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Amazon;
using AWSCDK.AppHost;

var builder = DistributedApplication.CreateBuilder(args);

// Setup a configuration for the AWS .NET SDK.
var awsConfig = builder.AddAWSSDKConfig()
.WithProfile("default")
.WithRegion(RegionEndpoint.EUWest1);

var stack = builder.AddAWSCDKStack("stack", "Aspire-stack").WithReference(awsConfig);
var customStack = builder.AddAWSCDKStack("custom", scope => new CustomStack(scope, "Aspire-custom"));
customStack.AddOutput("BucketName", stack => stack.Bucket.BucketName).WithReference(awsConfig);

var topic = stack.AddSNSTopic("topic");
var queue = stack.AddSQSQueue("queue");
topic.AddSubscription(queue);

builder.AddProject<Projects.Frontend>("frontend")
//.WithReference(stack) // Reference all outputs of a construct
.WithEnvironment("AWS__Resources__BucketName", customStack.GetOutput("BucketName")) // Reference a construct/stack output
.WithEnvironment("AWS__Resources__ChatTopicArn", topic, t => t.TopicArn);

builder.Build().Run();
41 changes: 41 additions & 0 deletions playground/AWS/AWSCDK.AppHost/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:15887;http://localhost:15888",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16175",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:17037"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15888",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16175",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:17038",
"ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true"
}
},
"generate-manifest": {
"commandName": "Project",
"commandLineArgs": "--publisher manifest --output-path ./aspire-manifest.json",
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:15888",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16175"
}
}
}
}
26 changes: 26 additions & 0 deletions playground/AWS/AWSCDK.AppHost/WebAppStack.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Amazon.CDK;
using Amazon.CDK.AWS.DynamoDB;
using Constructs;
using Attribute = Amazon.CDK.AWS.DynamoDB.Attribute;

namespace AWSCDK.AppHost;

public class WebAppStackProps : StackProps;

public class WebAppStack : Stack
{
public ITable Table { get; }

public WebAppStack(Construct scope, string id, WebAppStackProps props)
: base(scope, id, props)
{
Table = new Table(this, "Table", new TableProps
{
PartitionKey = new Attribute { Name = "id", Type = AttributeType.STRING },
BillingMode = BillingMode.PAY_PER_REQUEST
});
}
}
50 changes: 50 additions & 0 deletions playground/AWS/AWSCDK.AppHost/aspire-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://json.schemastore.org/aspire-8.0.json",
"resources": {
"stack": {
"type": "aws.cloudformation.template.v0",
"stack-name": "Aspire-stack",
"template-path": "cdk.out/Aspire-stack.template.json",
"references": [
{
"target-resource": "frontend"
}
]
},
"custom": {
"type": "aws.cloudformation.template.v0",
"stack-name": "Aspire-custom",
"template-path": "cdk.out/Aspire-custom.template.json",
"references": [
{
"target-resource": "frontend"
}
]
},
"frontend": {
"type": "project.v0",
"path": "../Frontend/Frontend.csproj",
"env": {
"OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES": "true",
"OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES": "true",
"OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY": "in_memory",
"ASPNETCORE_FORWARDEDHEADERS_ENABLED": "true",
"HTTP_PORTS": "{frontend.bindings.http.targetPort}",
"AWS__Resources__BucketName": "{custom.output.BucketName}",
"AWS__Resources__ChatTopicArn": "{stack.output.topic8C050C71AWSResourcesChatTopicArn}"
},
"bindings": {
"http": {
"scheme": "http",
"protocol": "tcp",
"transport": "http"
},
"https": {
"scheme": "https",
"protocol": "tcp",
"transport": "http"
}
}
}
}
}
63 changes: 63 additions & 0 deletions playground/AWS/AWSCDK.AppHost/cdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"app": "dotnet run -- --publisher manifest --output-path ./aspire-manifest.json",
"watch": {
"include": [
"**"
],
"exclude": [
"README.md",
"cdk*.json",
"src/*/obj",
"src/*/bin",
"src/*.sln",
"src/*/GlobalSuppressions.cs",
"src/*/*.csproj"
]
},
"context": {
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
"@aws-cdk/core:checkSecretUsage": true,
"@aws-cdk/core:target-partitions": [
"aws",
"aws-cn"
],
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
"@aws-cdk/aws-iam:minimizePolicies": true,
"@aws-cdk/core:validateSnapshotRemovalPolicy": true,
"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
"@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
"@aws-cdk/core:enablePartitionLiterals": true,
"@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
"@aws-cdk/aws-iam:standardizedServicePrincipals": true,
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
"@aws-cdk/aws-route53-patters:useCertificate": true,
"@aws-cdk/customresources:installLatestAwsSdkDefault": false,
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
"@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
"@aws-cdk/aws-redshift:columnId": true,
"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
"@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
"@aws-cdk/aws-kms:aliasNameRef": true,
"@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
"@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
"@aws-cdk/aws-efs:denyAnonymousAccess": true,
"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
"@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
"@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
"@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
"@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
"@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
"@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true
}
}
Loading