The CDKDefaultsProvider is a versioned system used to manage default values and behaviors for AWS resources within the Aspire integration. It provides a mechanism for the library to evolve its default configurations (like ElastiCache engine versions or ECS service types) without forcing breaking changes on users.
Users can choose which version of defaults to use via the CDKDefaultsProviderFactory, allowing them to opt-in to new behaviors when they are ready. The system follows a hierarchy where you can use a standard version or implement a custom provider to override specific defaults.
// Use the latest preview version
builder.AddAWSCDKEnvironment(
name: "MyApp",
cdkDefaultsProviderFactory: CDKDefaultsProviderFactory.Preview_V1
);