Skip to content

Commit e3fe16a

Browse files
tas50claude
andcommitted
🧹 Convert enable/disable string enums to bool in AWS resources
SageMaker directInternetAccess/rootAccess and transit gateway autoAcceptSharedAttachments/defaultRouteTableAssociation/ defaultRouteTablePropagation/dnsSupport/multicastSupport/ vpnEcmpSupport are all two-state enums that map naturally to bool. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c746365 commit e3fe16a

File tree

4 files changed

+62
-62
lines changed

4 files changed

+62
-62
lines changed

providers/aws/resources/aws.lr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,9 +1398,9 @@ private aws.sagemaker.notebookinstancedetails @defaults("arn") {
13981398
// KMS key used to encrypt data
13991399
kmsKey() aws.kms.key
14001400
// Whether SageMaker provides internet access to the instance
1401-
directInternetAccess string
1401+
directInternetAccess bool
14021402
// Whether root access is enabled for users of the notebook instance
1403-
rootAccess string
1403+
rootAccess bool
14041404
// Minimum IMDS version the notebook instance supports (1 or 2)
14051405
minimumInstanceMetadataServiceVersion string
14061406
// VPC subnet the notebook instance is deployed in
@@ -4662,18 +4662,18 @@ private aws.ec2.transitgateway @defaults("arn id state") {
46624662
tags map[string]string
46634663
// Private Autonomous System Number (ASN) for the Amazon side of a BGP session
46644664
amazonSideAsn int
4665-
// Whether attachment requests are automatically accepted (enable or disable)
4666-
autoAcceptSharedAttachments string
4667-
// Whether resource attachments are automatically associated with the default route table (enable or disable)
4668-
defaultRouteTableAssociation string
4669-
// Whether resource attachments automatically propagate routes to the default route table (enable or disable)
4670-
defaultRouteTablePropagation string
4671-
// Whether DNS support is enabled (enable or disable)
4672-
dnsSupport string
4673-
// Whether multicast is enabled (enable or disable)
4674-
multicastSupport string
4675-
// Whether Equal Cost Multipath Protocol support is enabled (enable or disable)
4676-
vpnEcmpSupport string
4665+
// Whether attachment requests are automatically accepted
4666+
autoAcceptSharedAttachments bool
4667+
// Whether resource attachments are automatically associated with the default route table
4668+
defaultRouteTableAssociation bool
4669+
// Whether resource attachments automatically propagate routes to the default route table
4670+
defaultRouteTablePropagation bool
4671+
// Whether DNS support is enabled
4672+
dnsSupport bool
4673+
// Whether multicast is enabled
4674+
multicastSupport bool
4675+
// Whether Equal Cost Multipath Protocol support is enabled
4676+
vpnEcmpSupport bool
46774677
// Transit gateway CIDR blocks
46784678
transitGatewayCidrBlocks []string
46794679
// ID of the default association route table

providers/aws/resources/aws.lr.go

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

providers/aws/resources/aws_ec2.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,20 +2225,20 @@ func (a *mqlAwsEc2) getTransitGateways(conn *connection.AwsConnection) []*jobpoo
22252225

22262226
// Flatten Options
22272227
var amazonSideAsn int64
2228-
var autoAcceptSharedAttachments, defaultRouteTableAssociation, defaultRouteTablePropagation string
2229-
var dnsSupport, multicastSupport, vpnEcmpSupport string
2228+
var autoAcceptSharedAttachments, defaultRouteTableAssociation, defaultRouteTablePropagation bool
2229+
var dnsSupport, multicastSupport, vpnEcmpSupport bool
22302230
var transitGatewayCidrBlocks []string
22312231
var associationDefaultRouteTableId, propagationDefaultRouteTableId string
22322232
if opts := tgw.Options; opts != nil {
22332233
if opts.AmazonSideAsn != nil {
22342234
amazonSideAsn = *opts.AmazonSideAsn
22352235
}
2236-
autoAcceptSharedAttachments = string(opts.AutoAcceptSharedAttachments)
2237-
defaultRouteTableAssociation = string(opts.DefaultRouteTableAssociation)
2238-
defaultRouteTablePropagation = string(opts.DefaultRouteTablePropagation)
2239-
dnsSupport = string(opts.DnsSupport)
2240-
multicastSupport = string(opts.MulticastSupport)
2241-
vpnEcmpSupport = string(opts.VpnEcmpSupport)
2236+
autoAcceptSharedAttachments = string(opts.AutoAcceptSharedAttachments) == "enable"
2237+
defaultRouteTableAssociation = string(opts.DefaultRouteTableAssociation) == "enable"
2238+
defaultRouteTablePropagation = string(opts.DefaultRouteTablePropagation) == "enable"
2239+
dnsSupport = string(opts.DnsSupport) == "enable"
2240+
multicastSupport = string(opts.MulticastSupport) == "enable"
2241+
vpnEcmpSupport = string(opts.VpnEcmpSupport) == "enable"
22422242
transitGatewayCidrBlocks = opts.TransitGatewayCidrBlocks
22432243
associationDefaultRouteTableId = convert.ToValue(opts.AssociationDefaultRouteTableId)
22442244
propagationDefaultRouteTableId = convert.ToValue(opts.PropagationDefaultRouteTableId)
@@ -2255,12 +2255,12 @@ func (a *mqlAwsEc2) getTransitGateways(conn *connection.AwsConnection) []*jobpoo
22552255
"createdAt": llx.TimeDataPtr(tgw.CreationTime),
22562256
"tags": llx.MapData(toInterfaceMap(ec2TagsToMap(tgw.Tags)), types.String),
22572257
"amazonSideAsn": llx.IntData(amazonSideAsn),
2258-
"autoAcceptSharedAttachments": llx.StringData(autoAcceptSharedAttachments),
2259-
"defaultRouteTableAssociation": llx.StringData(defaultRouteTableAssociation),
2260-
"defaultRouteTablePropagation": llx.StringData(defaultRouteTablePropagation),
2261-
"dnsSupport": llx.StringData(dnsSupport),
2262-
"multicastSupport": llx.StringData(multicastSupport),
2263-
"vpnEcmpSupport": llx.StringData(vpnEcmpSupport),
2258+
"autoAcceptSharedAttachments": llx.BoolData(autoAcceptSharedAttachments),
2259+
"defaultRouteTableAssociation": llx.BoolData(defaultRouteTableAssociation),
2260+
"defaultRouteTablePropagation": llx.BoolData(defaultRouteTablePropagation),
2261+
"dnsSupport": llx.BoolData(dnsSupport),
2262+
"multicastSupport": llx.BoolData(multicastSupport),
2263+
"vpnEcmpSupport": llx.BoolData(vpnEcmpSupport),
22642264
"transitGatewayCidrBlocks": llx.ArrayData(convert.SliceAnyToInterface(transitGatewayCidrBlocks), types.String),
22652265
"associationDefaultRouteTableId": llx.StringData(associationDefaultRouteTableId),
22662266
"propagationDefaultRouteTableId": llx.StringData(propagationDefaultRouteTableId),

providers/aws/resources/aws_sagemaker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ func (a *mqlAwsSagemakerNotebookinstance) details() (*mqlAwsSagemakerNotebookins
237237
}
238238
args := map[string]*llx.RawData{
239239
"arn": llx.StringDataPtr(instanceDetails.NotebookInstanceArn),
240-
"directInternetAccess": llx.StringData(string(instanceDetails.DirectInternetAccess)),
241-
"rootAccess": llx.StringData(string(instanceDetails.RootAccess)),
240+
"directInternetAccess": llx.BoolData(string(instanceDetails.DirectInternetAccess) == "Enabled"),
241+
"rootAccess": llx.BoolData(string(instanceDetails.RootAccess) == "Enabled"),
242242
}
243243
if instanceDetails.InstanceMetadataServiceConfiguration != nil {
244244
args["minimumInstanceMetadataServiceVersion"] = llx.StringDataPtr(instanceDetails.InstanceMetadataServiceConfiguration.MinimumInstanceMetadataServiceVersion)

0 commit comments

Comments
 (0)