Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(service-spec): the spec treats any nested anyOf or oneOf as a union type #1269

Merged
merged 24 commits into from
Sep 12, 2024

Conversation

comcalvi
Copy link
Contributor

@comcalvi comcalvi commented Aug 27, 2024

Improves handling of oneOf clauses. oneOf is able to define entire types:

properties: {
  foo: {
    oneOf: [
      {  type: 'string' },
      { type: 'number' },
  ],
 }
}

They can also contain references:

properties: {
  foo: {
    oneOf: [
      { Foo: { Ref: 'something' } },
      { Bar: { Ref: 'something' } },
  ],
 }
}

Previously, we were not processing these correctly.

@comcalvi comcalvi added the do-not-merge Do not merge this PR until further notice label Aug 27, 2024
github-actions and others added 6 commits August 27, 2024 22:37
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
branch 'comcalvi/union-errors' of github.com:cdklabs/awscdk-service-spec into comcalvi/union-errors
@comcalvi
Copy link
Contributor Author

This breaks valid union types...MediaLive::MultiplexProgram::MultiplexVideoSettings used to be handled as a union type, but it no longer is.

@comcalvi
Copy link
Contributor Author

Old Union Handling:

API elements with incompatible changes:

err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.ConfluenceCrawlerConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.ConfluenceCrawlerConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.ConfluenceDataSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.ConfluenceDataSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.ConfluenceSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.ConfluenceSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.CrawlFilterConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.CrawlFilterConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.DataSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.DataSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.PatternObjectFilterConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.PatternObjectFilterConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.PatternObjectFilterProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.PatternObjectFilterProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.S3DataSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.S3DataSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.SalesforceCrawlerConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.SalesforceCrawlerConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.SalesforceDataSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.SalesforceDataSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.SalesforceSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.SalesforceSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.SeedUrlProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.SeedUrlProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.SharePointCrawlerConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.SharePointCrawlerConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.SharePointDataSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.SharePointDataSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.SharePointSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.SharePointSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.UrlConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.UrlConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.WebCrawlerConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.WebCrawlerConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.WebCrawlerLimitsProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.WebCrawlerLimitsProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.WebDataSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.WebDataSourceConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_bedrock.CfnDataSource.WebSourceConfigurationProperty: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.WebSourceConfigurationProperty]
err  - PROP aws-cdk-lib.aws_bedrock.CfnDataSource.dataSourceConfiguration: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSource.dataSourceConfiguration]
err  - PROP aws-cdk-lib.aws_bedrock.CfnDataSourceProps.dataSourceConfiguration: has been removed [removed:aws-cdk-lib.aws_bedrock.CfnDataSourceProps.dataSourceConfiguration]
err  - IFACE aws-cdk-lib.aws_quicksight.CfnDataSet.DataSetRefreshPropertiesProperty: formerly required property 'refreshConfiguration' is optional: type of aws-cdk-lib.aws_quicksight.CfnDataSet.dataSetRefreshProperties [weakened:aws-cdk-lib.aws_quicksight.CfnDataSet.DataSetRefreshPropertiesProperty]

New Union Handling:

API elements with incompatible changes:

err  - IFACE aws-cdk-lib.aws_medialive.CfnMultiplexprogram.MultiplexStatmuxVideoSettingsProperty: has been removed [removed:aws-cdk-lib.aws_medialive.CfnMultiplexprogram.MultiplexStatmuxVideoSettingsProperty]
err  - IFACE aws-cdk-lib.aws_medialive.CfnMultiplexprogram.MultiplexVideoSettingsProperty: has been removed [removed:aws-cdk-lib.aws_medialive.CfnMultiplexprogram.MultiplexVideoSettingsProperty]
err  - IFACE aws-cdk-lib.aws_s3.CfnBucket.PartitionedPrefixProperty: has been removed [removed:aws-cdk-lib.aws_s3.CfnBucket.PartitionedPrefixProperty]
err  - IFACE aws-cdk-lib.aws_s3.CfnBucket.TargetObjectKeyFormatProperty: has been removed [removed:aws-cdk-lib.aws_s3.CfnBucket.TargetObjectKeyFormatProperty]
err  - IFACE aws-cdk-lib.aws_events.CfnConnectionProps: newly required property 'authParameters' used to be optional: input to aws-cdk-lib.aws_events.CfnConnection.<initializer> [strengthened:aws-cdk-lib.aws_events.CfnConnectionProps]
err  - IFACE aws-cdk-lib.aws_medialive.CfnMultiplexprogram.MultiplexProgramSettingsProperty: property videoSettings, none of any are assignable to aws-cdk-lib.IResolvable | aws-cdk-lib.aws_medialive.CfnMultiplexprogram.MultiplexVideoSettingsProperty, any is not assignable to aws-cdk-lib.IResolvable, any is not assignable to aws-cdk-lib.aws_medialive.CfnMultiplexprogram.MultiplexVideoSettingsProperty: type of aws-cdk-lib.aws_medialive.CfnMultiplexprogram.multiplexProgramSettings [weakened:aws-cdk-lib.aws_medialive.CfnMultiplexprogram.MultiplexProgramSettingsProperty]
err  - IFACE aws-cdk-lib.aws_quicksight.CfnDataSet.DataSetRefreshPropertiesProperty: formerly required property 'refreshConfiguration' is optional: type of aws-cdk-lib.aws_quicksight.CfnDataSet.dataSetRefreshProperties [weakened:aws-cdk-lib.aws_quicksight.CfnDataSet.DataSetRefreshPropertiesProperty]
err  - IFACE aws-cdk-lib.aws_s3.CfnBucket.LoggingConfigurationProperty: property targetObjectKeyFormat, none of any are assignable to aws-cdk-lib.IResolvable | aws-cdk-lib.aws_s3.CfnBucket.TargetObjectKeyFormatProperty, any is not assignable to aws-cdk-lib.IResolvable, any is not assignable to aws-cdk-lib.aws_s3.CfnBucket.TargetObjectKeyFormatProperty: type of aws-cdk-lib.aws_s3.CfnBucket.loggingConfiguration [weakened:aws-cdk-lib.aws_s3.CfnBucket.LoggingConfigurationProperty]
err  - IFACE aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps: newly required property 'notificationConfiguration' added: input to aws-cdk-lib.aws_securitylake.CfnSubscriberNotification.<initializer> [strengthened:aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps]
skip - PROP aws-cdk-lib.aws_events.CfnConnection.authParameters: changed to aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty (formerly Optional<aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty>): mutable property cannot change type [changed-type:aws-cdk-lib.aws_events.CfnConnection.authParameters]

@comcalvi
Copy link
Contributor Author

and this third method of handling them:

API elements with incompatible changes:
err  - IFACE aws-cdk-lib.aws_iotfleetwise.CfnDecoderManifest.CanNetworkInterfaceProperty: has been removed [removed:aws-cdk-lib.aws_iotfleetwise.CfnDecoderManifest.CanNetworkInterfaceProperty]
err  - IFACE aws-cdk-lib.aws_iotfleetwise.CfnDecoderManifest.CanSignalDecoderProperty: has been removed [removed:aws-cdk-lib.aws_iotfleetwise.CfnDecoderManifest.CanSignalDecoderProperty]
err  - IFACE aws-cdk-lib.aws_iotfleetwise.CfnDecoderManifest.ObdNetworkInterfaceProperty: has been removed [removed:aws-cdk-lib.aws_iotfleetwise.CfnDecoderManifest.ObdNetworkInterfaceProperty]
err  - IFACE aws-cdk-lib.aws_iotfleetwise.CfnDecoderManifest.ObdSignalDecoderProperty: has been removed [removed:aws-cdk-lib.aws_iotfleetwise.CfnDecoderManifest.ObdSignalDecoderProperty]
err  - IFACE aws-cdk-lib.aws_events.CfnConnectionProps: newly required property 'authParameters' used to be optional: input to aws-cdk-lib.aws_events.CfnConnection.<initializer> [strengthened:aws-cdk-lib.aws_events.CfnConnectionProps]
err  - IFACE aws-cdk-lib.aws_quicksight.CfnDataSet.DataSetRefreshPropertiesProperty: formerly required property 'refreshConfiguration' is optional: type of aws-cdk-lib.aws_quicksight.CfnDataSet.dataSetRefreshProperties [weakened:aws-cdk-lib.aws_quicksight.CfnDataSet.DataSetRefreshPropertiesProperty]
err  - IFACE aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps: newly required property 'notificationConfiguration' added: input to aws-cdk-lib.aws_securitylake.CfnSubscriberNotification.<initializer> [strengthened:aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps]
skip - PROP aws-cdk-lib.aws_events.CfnConnection.authParameters: changed to aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty (formerly Optional<aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty>): mutable property cannot change type [changed-type:aws-cdk-lib.aws_events.CfnConnection.authParameters]

@comcalvi
Copy link
Contributor Author

it shrinks...

 API elements with incompatible changes:
err  - IFACE aws-cdk-lib.aws_events.CfnConnectionProps: newly required property 'authParameters' used to be optional: input to aws-cdk-lib.aws_events.CfnConnection.<initializer> [strengthened:aws-cdk-lib.aws_events.CfnConnectionProps]
err  - IFACE aws-cdk-lib.aws_quicksight.CfnDataSet.DataSetRefreshPropertiesProperty: formerly required property 'refreshConfiguration' is optional: type of aws-cdk-lib.aws_quicksight.CfnDataSet.dataSetRefreshProperties [weakened:aws-cdk-lib.aws_quicksight.CfnDataSet.DataSetRefreshPropertiesProperty]
err  - IFACE aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps: newly required property 'notificationConfiguration' added: input to aws-cdk-lib.aws_securitylake.CfnSubscriberNotification.<initializer> [strengthened:aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps]
skip - PROP aws-cdk-lib.aws_events.CfnConnection.authParameters: changed to aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty (formerly Optional<aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty>): mutable property cannot change type [changed-type:aws-cdk-lib.aws_events.CfnConnection.authParameters]

@comcalvi
Copy link
Contributor Author

pulled from main:

PI elements with incompatible changes:
err  - IFACE aws-cdk-lib.aws_events.CfnConnectionProps: newly required property 'authParameters' used to be optional: input to aws-cdk-lib.aws_events.CfnConnection.<initializer> [strengthened:aws-cdk-lib.aws_events.CfnConnectionProps]
err  - IFACE aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps: newly required property 'notificationConfiguration' added: input to aws-cdk-lib.aws_securitylake.CfnSubscriberNotification.<initializer> [strengthened:aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps]
skip - PROP aws-cdk-lib.aws_events.CfnConnection.authParameters: changed to aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty (formerly Optional<aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty>): mutable property cannot change type [changed-type:aws-cdk-lib.aws_events.CfnConnection.authParameters]

@comcalvi
Copy link
Contributor Author

Fixed it back to

 API elements with incompatible changes:
err  - IFACE aws-cdk-lib.aws_events.CfnConnectionProps: newly required property 'authParameters' used to be optional: input to aws-cdk-lib.aws_events.CfnConnection.<initializer> [strengthened:aws-cdk-lib.aws_events.CfnConnectionProps]
err  - IFACE aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps: newly required property 'notificationConfiguration' added: input to aws-cdk-lib.aws_securitylake.CfnSubscriberNotification.<initializer> [strengthened:aws-cdk-lib.aws_securitylake.CfnSubscriberNotificationProps]
skip - PROP aws-cdk-lib.aws_events.CfnConnection.authParameters: changed to aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty (formerly Optional<aws-cdk-lib.IResolvable | aws-cdk-lib.aws_events.CfnConnection.AuthParametersProperty>): mutable property cannot change type [changed-type:aws-cdk-lib.aws_events.CfnConnection.authParameters]

@comcalvi
Copy link
Contributor Author

comcalvi commented Aug 30, 2024

authParameters is required in one region, but not another. notificationConfiguration is required in every region in the new schema and not mentioned in the old one.

@comcalvi
Copy link
Contributor Author

authParameters is meant to be required. You can't deploy without it.

@comcalvi comcalvi removed the do-not-merge Do not merge this PR until further notice label Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

@aws-cdk/aws-service-spec: Model database diff detected

├[~] service aws-applicationinsights
│ └ resources
│    └[~] resource AWS::ApplicationInsights::Application
│      └ types
│         ├[~] type ConfigurationDetails
│         │ └ properties
│         │    ├[+] NetWeaverPrometheusExporter: NetWeaverPrometheusExporter
│         │    ├[+] Processes: Array<Process>
│         │    └[+] SQLServerPrometheusExporter: SQLServerPrometheusExporter
│         ├[+] type NetWeaverPrometheusExporter
│         │ ├  documentation: The NetWeaver Prometheus Exporter Settings.
│         │ │  name: NetWeaverPrometheusExporter
│         │ └ properties
│         │    ├SAPSID: string (required)
│         │    ├InstanceNumbers: Array<string> (required)
│         │    └PrometheusPort: string
│         ├[+] type Process
│         │ ├  documentation: A process to be monitored for the component.
│         │ │  name: Process
│         │ └ properties
│         │    ├ProcessName: string (required)
│         │    └AlarmMetrics: Array<AlarmMetric> (required)
│         ├[+] type SQLServerPrometheusExporter
│         │ ├  documentation: The SQL prometheus exporter settings.
│         │ │  name: SQLServerPrometheusExporter
│         │ └ properties
│         │    ├PrometheusPort: string (required)
│         │    └SQLSecretName: string (required)
│         └[~] type SubComponentConfigurationDetails
│           └ properties
│              └[+] Processes: Array<Process>
├[~] service aws-databrew
│ └ resources
│    └[~] resource AWS::DataBrew::Recipe
│      └ types
│         └[~] type RecipeParameters
│           └ properties
│              └ Input: - json
│                       + Input ⇐ json
├[~] service aws-events
│ └ resources
│    └[~] resource AWS::Events::Connection
│      ├ properties
│      │  └ AuthParameters: - AuthParameters
│      │                    + AuthParameters (required)
│      └ types
│         └[~] type Parameter
│           └ properties
│              └ IsValueSecret: - boolean
│                               + boolean (default=true)
├[~] service aws-fms
│ └ resources
│    └[~] resource AWS::FMS::Policy
│      └ types
│         ├[+] type NetworkAclCommonPolicy
│         │ └  documentation: Defines a Firewall Manager network ACL policy. This is used in the `PolicyOption` of a `SecurityServicePolicyData` for a `Policy` , when the `SecurityServicePolicyData` type is set to `NETWORK_ACL_COMMON` .
│         │    For information about network ACLs, see [Control traffic to subnets using network ACLs](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html) in the *Amazon Virtual Private Cloud User Guide* .
│         │    name: NetworkAclCommonPolicy
│         └[~] type PolicyOption
│           └ properties
│              └[+] NetworkAclCommonPolicy: NetworkAclCommonPolicy
├[~] service aws-iotsitewise
│ └ resources
│    └[~] resource AWS::IoTSiteWise::Gateway
│      └ types
│         ├[~] type GatewayPlatform
│         │ └ properties
│         │    └[+] SiemensIE: SiemensIE
│         └[+] type SiemensIE
│           ├  documentation: Contains the IotCoreThingName of AWS IoT Thing that the gateway runs on.
│           │  name: SiemensIE
│           └ properties
│              └IotCoreThingName: string (required)
├[~] service aws-iotwireless
│ └ resources
│    └[~] resource AWS::IoTWireless::WirelessDevice
│      └ types
│         ├[+] type Application
│         │ ├  documentation: A list of optional LoRaWAN application information, which can be used for geolocation.
│         │ │  name: Application
│         │ └ properties
│         │    ├DestinationName: string
│         │    ├FPort: integer
│         │    └Type: string
│         ├[+] type FPorts
│         │ ├  documentation: List of FPorts assigned for different LoRaWAN application packages to use.
│         │ │  name: FPorts
│         │ └ properties
│         │    └Applications: Array<Application>
│         └[~] type LoRaWANDevice
│           └ properties
│              └[+] FPorts: FPorts
├[~] service aws-securityhub
│ └ resources
│    └[~] resource AWS::SecurityHub::SecurityControl
│      └ types
│         ├[~] type ParameterConfiguration
│         │ └ properties
│         │    └[+] Value: ParameterValue
│         └[+] type ParameterValue
│           ├  documentation: An object that includes the data type of a security control parameter and its current value.
│           │  name: ParameterValue
│           └ properties
│              ├Boolean: boolean
│              ├Double: number
│              ├Enum: string
│              ├EnumList: Array<string>
│              ├Integer: integer
│              ├IntegerList: Array<integer>
│              ├String: string
│              └StringList: Array<string>
└[~] service aws-securitylake
  └ resources
     └[~] resource AWS::SecurityLake::SubscriberNotification
       ├ properties
       │  └[+] NotificationConfiguration: NotificationConfiguration (required)
       └ types
          ├[+] type HttpsNotificationConfiguration
          │ ├  documentation: Specify the configurations you want to use for HTTPS subscriber notification.
          │ │  name: HttpsNotificationConfiguration
          │ └ properties
          │    ├AuthorizationApiKeyName: string
          │    ├AuthorizationApiKeyValue: string
          │    ├Endpoint: string (required)
          │    ├HttpMethod: string
          │    └TargetRoleArn: string (required)
          └[+] type NotificationConfiguration
            ├  documentation: Specify the configurations you want to use for subscriber notification. The subscriber is notified when new data is written to the data lake for sources that the subscriber consumes in Security Lake .
            │  name: NotificationConfiguration
            └ properties
               ├HttpsNotificationConfiguration: HttpsNotificationConfiguration
               └SqsNotificationConfiguration: json

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Sep 11, 2024
@GavinZZ GavinZZ removed this pull request from the merge queue due to a manual request Sep 11, 2024
@GavinZZ GavinZZ added the do-not-merge Do not merge this PR until further notice label Sep 11, 2024
@GavinZZ
Copy link
Contributor

GavinZZ commented Sep 11, 2024

Added a do-not-merge as I have some questions that want to clarify.

@@ -15,14 +17,18 @@ export namespace jsonschema {

export type EmptyObject = Record<string, never>;

export function isAnyType(x: Schema): x is AnyType {
export function isAnyType(x: Schema | CommonTypeCombinatorFields): x is AnyType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is CommonTypeCombinatorFields needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the entries in a oneOf list can be a CommonTypeCombinatorFields, and we check those entries with isAnyType below.

const requiredProps = Object.entries(resource.properties)
.filter(([_, value]) => value.required)
.map(([name, _]) => name);
expect(requiredProps.length).toBe(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it 0 as the expected value? Type is required no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type is on the SomeConfigurationProp type, it's not a propery of the AWS::OneOf::Required resource.

The only property that could be required is DataSourceConfiguration, which is not marked required.

@GavinZZ
Copy link
Contributor

GavinZZ commented Sep 11, 2024

resources
│    └[~] resource AWS::Events::Connection
│      ├ properties
│      │  └ AuthParameters: - AuthParameters
│      │                    + AuthParameters (required)
│      └ types
│         └[~] type Parameter
│           └ properties
│              └ IsValueSecret: - boolean
│                               + boolean (default=true)

This doesn't look right to me according to the cfn doc. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-connection.html#cfn-events-connection-authparameters

AuthParameters is not a required parameter.

@comcalvi
Copy link
Contributor Author

comcalvi commented Sep 12, 2024

This doesn't look right to me according to the cfn doc

I checked this, the docs are wrong; you can't deploy the resource without specifying the property.

❌  TestStack failed: Error: The stack named TestStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Invalid request provided: Couldn't create AWS::Events::Connection due to AuthorizationParameters not being provided."

@GavinZZ GavinZZ removed the do-not-merge Do not merge this PR until further notice label Sep 12, 2024
@comcalvi comcalvi added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit e9f585a Sep 12, 2024
11 checks passed
@comcalvi comcalvi deleted the comcalvi/union-errors branch September 12, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants