-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
FIS: Experiment Template Log Configuration Class Camel Cases LogGroupArn #29761
Comments
Confirmed in TypeScript and with import { CfnExperimentTemplate } from 'aws-cdk-lib/aws-fis';
// ...
new CfnExperimentTemplate(this, "ExperimentTemplate", {
description: "description",
roleArn: "roleArn",
logConfiguration: {
cloudWatchLogsConfiguration: {
logGroupArn: "logArn",
} satisfies CfnExperimentTemplate.CloudWatchLogsConfigurationProperty,
logSchemaVersion: 0,
},
stopConditions: [
{
source: "aws:cloudwatch:alarm",
value: "alarmArn",
},
],
targets: {
name: {
resourceType: "aws:ec2:instance",
resourceArns: ["resourceArn"],
selectionMode: "64",
},
},
}); $ npm run cdk synth
Resources:
ExperimentTemplate:
Type: AWS::FIS::ExperimentTemplate
Properties:
Description: description
LogConfiguration:
CloudWatchLogsConfiguration:
logGroupArn: logArn
LogSchemaVersion: 0
RoleArn: roleArn
StopConditions:
- Source: aws:cloudwatch:alarm
Value: alarmArn
Targets:
name:
ResourceArns:
- resourceArn
ResourceType: aws:ec2:instance
SelectionMode: "64" EDIT: Updated the repro, previous example didn't prove anything |
Not sure how the L1 generated constructs handle this, but I'm going to assume that this is happening because the I'm not great in C# @hakenmt, but what you can do in the meantime is just not type the LogConfiguration = new ExperimentTemplateLogConfigurationProperty() {
CloudWatchLogsConfiguration = new {
LogGroupArn = this.LogGroup.LogGroupArn
}
} |
Thanks for the workaround, I actually ended up doing this: this.PacketLossExperiment.AddOverride("Properties.LogConfiguration.CloudWatchLogsConfiguration.LogGroupArn", this.LogGroup.LogGroupArn);
this.PacketLossExperiment.AddOverride("Properties.LogConfiguration.CloudWatchLogsConfiguration.logGroupArn", null); I think both work, but obviously ideally would like to use the concrete generated type for the property if possible. The entire ExperimentTemplate construct is fairly hard to navigate, the Action and Target properties are both just |
Yeah, your solution at least keeps some type safety 👍 As far as the issues with the generated L1, I don't have a ton of insight into that process. There was an issue raised about creating an L2 construct for |
This property is typed any so we need to provide a JSON-like structure for it. related to #21767 |
@pahud From what I gather, https://github.com/cdklabs/awscdk-service-spec needs to get a patch PR to override the currently generated L1? |
@nmussy No, from my take, it's because it’s originally set to Json in cfnspec but at some point was added to an actual type by service team. To avoid breaking changes in CDK, we added a patch from awscdk-service-spec to make it always JSON type even it’s now typed in CFN. We have some other similar cases mentioned in #21767 |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
Using the
CfnExperimentTemplate
construct in .net. Using the below log group configuration.This produces output like the following:
The property
logGroupArn
isn't accepted by CloudFormation, it must beLogGroupArn
.Expected Behavior
Produces this output:
Current Behavior
Produces camel case name.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.133.0 (build dcc1e75)
Framework Version
No response
Node.js Version
v20.9.0
OS
darwin
Language
.NET
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: