From edaf7d905c4ef58a3b0d70de7e46cc58dbba4f06 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 15 Dec 2023 07:47:47 -0800 Subject: [PATCH] More fields in AWS resources (#2844) --- providers/aws/resources/aws.lr | 24 ++++ providers/aws/resources/aws.lr.go | 144 +++++++++++++++++++ providers/aws/resources/aws.lr.manifest.yaml | 24 ++++ providers/aws/resources/aws_dynamodb.go | 2 + providers/aws/resources/aws_vpc.go | 46 +++--- 5 files changed, 222 insertions(+), 18 deletions(-) diff --git a/providers/aws/resources/aws.lr b/providers/aws/resources/aws.lr index 893ce6f9fc..fffbbf5f79 100644 --- a/providers/aws/resources/aws.lr +++ b/providers/aws/resources/aws.lr @@ -71,6 +71,8 @@ private aws.vpc.routetable @defaults("id routes.length") { id string // A list of route descriptions routes []dict + // Tags on the route table + tags map[string]string } // Amazon Virtual Private Cloud (VPC) subnet @@ -87,6 +89,10 @@ private aws.vpc.subnet @defaults("id cidrs availabilityZone defaultForAvailabili availabilityZone string // Indicates whether this is the default subnet for the availability zone defaultForAvailabilityZone bool + // Whether a network interface created in this subnet (including a network interface created by RunInstances ) receives an IPv6 address. + assignIpv6AddressOnCreation bool + // The state of the subnet. Pending or available + state string } // Amazon Virtual Private Cloud (VPC) endpoint @@ -105,6 +111,12 @@ private aws.vpc.endpoint @defaults("id type region") { policyDocument string // The subnets for the (interface) endpoint subnets []string + // Whether to associate a private hosted zone with the specified VPC + privateDnsEnabled bool + // VPC endpoint state + state string + // Creation timestamp + createdAt time } // Amazon Virtual Private Cloud (VPC) flow log @@ -119,6 +131,14 @@ private aws.vpc.flowlog @defaults("id region status") { status string // Tags on the flow log tags map[string]string + // Creation timestamp + createdAt time + // The destination for the flow log data + destination string + // The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. The possible values are 60 seconds (1 minute) or 600 seconds (10 minutes). + maxAggregationInterval int + // The type of traffic to monitor. ACCEPT, ALL, and REJECT + trafficType string } // Amazon WAF v2 @@ -1714,6 +1734,10 @@ private aws.dynamodb.table @defaults("name region") { globalTableVersion string // The table ID id string + // The total size of the specified table, in bytes. DynamoDB updates this value approximately every six hours. + sizeBytes int + // The current state of the table. CREATING, UPDATING, DELETING, ACTIVE, INACCESSIBLE_ENCRYPTION_CREDENTIALS, ARCHIVING, or ARCHIVED. + status string } // Amazon Relational Database Service (RDS) diff --git a/providers/aws/resources/aws.lr.go b/providers/aws/resources/aws.lr.go index 57cfbffc4d..8360aabe28 100644 --- a/providers/aws/resources/aws.lr.go +++ b/providers/aws/resources/aws.lr.go @@ -771,6 +771,9 @@ var getDataFields = map[string]func(r plugin.Resource) *plugin.DataRes{ "aws.vpc.routetable.routes": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsVpcRoutetable).GetRoutes()).ToDataRes(types.Array(types.Dict)) }, + "aws.vpc.routetable.tags": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcRoutetable).GetTags()).ToDataRes(types.Map(types.String, types.String)) + }, "aws.vpc.subnet.arn": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsVpcSubnet).GetArn()).ToDataRes(types.String) }, @@ -789,6 +792,12 @@ var getDataFields = map[string]func(r plugin.Resource) *plugin.DataRes{ "aws.vpc.subnet.defaultForAvailabilityZone": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsVpcSubnet).GetDefaultForAvailabilityZone()).ToDataRes(types.Bool) }, + "aws.vpc.subnet.assignIpv6AddressOnCreation": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcSubnet).GetAssignIpv6AddressOnCreation()).ToDataRes(types.Bool) + }, + "aws.vpc.subnet.state": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcSubnet).GetState()).ToDataRes(types.String) + }, "aws.vpc.endpoint.id": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsVpcEndpoint).GetId()).ToDataRes(types.String) }, @@ -810,6 +819,15 @@ var getDataFields = map[string]func(r plugin.Resource) *plugin.DataRes{ "aws.vpc.endpoint.subnets": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsVpcEndpoint).GetSubnets()).ToDataRes(types.Array(types.String)) }, + "aws.vpc.endpoint.privateDnsEnabled": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcEndpoint).GetPrivateDnsEnabled()).ToDataRes(types.Bool) + }, + "aws.vpc.endpoint.state": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcEndpoint).GetState()).ToDataRes(types.String) + }, + "aws.vpc.endpoint.createdAt": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcEndpoint).GetCreatedAt()).ToDataRes(types.Time) + }, "aws.vpc.flowlog.id": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsVpcFlowlog).GetId()).ToDataRes(types.String) }, @@ -825,6 +843,18 @@ var getDataFields = map[string]func(r plugin.Resource) *plugin.DataRes{ "aws.vpc.flowlog.tags": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsVpcFlowlog).GetTags()).ToDataRes(types.Map(types.String, types.String)) }, + "aws.vpc.flowlog.createdAt": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcFlowlog).GetCreatedAt()).ToDataRes(types.Time) + }, + "aws.vpc.flowlog.destination": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcFlowlog).GetDestination()).ToDataRes(types.String) + }, + "aws.vpc.flowlog.maxAggregationInterval": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcFlowlog).GetMaxAggregationInterval()).ToDataRes(types.Int) + }, + "aws.vpc.flowlog.trafficType": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsVpcFlowlog).GetTrafficType()).ToDataRes(types.String) + }, "aws.waf.acls": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsWaf).GetAcls()).ToDataRes(types.Array(types.Resource("aws.waf.acl"))) }, @@ -2559,6 +2589,12 @@ var getDataFields = map[string]func(r plugin.Resource) *plugin.DataRes{ "aws.dynamodb.table.id": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsDynamodbTable).GetId()).ToDataRes(types.String) }, + "aws.dynamodb.table.sizeBytes": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsDynamodbTable).GetSizeBytes()).ToDataRes(types.Int) + }, + "aws.dynamodb.table.status": func(r plugin.Resource) *plugin.DataRes { + return (r.(*mqlAwsDynamodbTable).GetStatus()).ToDataRes(types.String) + }, "aws.rds.dbInstances": func(r plugin.Resource) *plugin.DataRes { return (r.(*mqlAwsRds).GetDbInstances()).ToDataRes(types.Array(types.Resource("aws.rds.dbinstance"))) }, @@ -3649,6 +3685,10 @@ var setDataFields = map[string]func(r plugin.Resource, v *llx.RawData) bool { r.(*mqlAwsVpcRoutetable).Routes, ok = plugin.RawToTValue[[]interface{}](v.Value, v.Error) return }, + "aws.vpc.routetable.tags": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcRoutetable).Tags, ok = plugin.RawToTValue[map[string]interface{}](v.Value, v.Error) + return + }, "aws.vpc.subnet.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { r.(*mqlAwsVpcSubnet).__id, ok = v.Value.(string) return @@ -3677,6 +3717,14 @@ var setDataFields = map[string]func(r plugin.Resource, v *llx.RawData) bool { r.(*mqlAwsVpcSubnet).DefaultForAvailabilityZone, ok = plugin.RawToTValue[bool](v.Value, v.Error) return }, + "aws.vpc.subnet.assignIpv6AddressOnCreation": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcSubnet).AssignIpv6AddressOnCreation, ok = plugin.RawToTValue[bool](v.Value, v.Error) + return + }, + "aws.vpc.subnet.state": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcSubnet).State, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, "aws.vpc.endpoint.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { r.(*mqlAwsVpcEndpoint).__id, ok = v.Value.(string) return @@ -3709,6 +3757,18 @@ var setDataFields = map[string]func(r plugin.Resource, v *llx.RawData) bool { r.(*mqlAwsVpcEndpoint).Subnets, ok = plugin.RawToTValue[[]interface{}](v.Value, v.Error) return }, + "aws.vpc.endpoint.privateDnsEnabled": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcEndpoint).PrivateDnsEnabled, ok = plugin.RawToTValue[bool](v.Value, v.Error) + return + }, + "aws.vpc.endpoint.state": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcEndpoint).State, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "aws.vpc.endpoint.createdAt": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcEndpoint).CreatedAt, ok = plugin.RawToTValue[*time.Time](v.Value, v.Error) + return + }, "aws.vpc.flowlog.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { r.(*mqlAwsVpcFlowlog).__id, ok = v.Value.(string) return @@ -3733,6 +3793,22 @@ var setDataFields = map[string]func(r plugin.Resource, v *llx.RawData) bool { r.(*mqlAwsVpcFlowlog).Tags, ok = plugin.RawToTValue[map[string]interface{}](v.Value, v.Error) return }, + "aws.vpc.flowlog.createdAt": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcFlowlog).CreatedAt, ok = plugin.RawToTValue[*time.Time](v.Value, v.Error) + return + }, + "aws.vpc.flowlog.destination": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcFlowlog).Destination, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, + "aws.vpc.flowlog.maxAggregationInterval": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcFlowlog).MaxAggregationInterval, ok = plugin.RawToTValue[int64](v.Value, v.Error) + return + }, + "aws.vpc.flowlog.trafficType": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsVpcFlowlog).TrafficType, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, "aws.waf.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { r.(*mqlAwsWaf).__id, ok = v.Value.(string) return @@ -6473,6 +6549,14 @@ var setDataFields = map[string]func(r plugin.Resource, v *llx.RawData) bool { r.(*mqlAwsDynamodbTable).Id, ok = plugin.RawToTValue[string](v.Value, v.Error) return }, + "aws.dynamodb.table.sizeBytes": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsDynamodbTable).SizeBytes, ok = plugin.RawToTValue[int64](v.Value, v.Error) + return + }, + "aws.dynamodb.table.status": func(r plugin.Resource, v *llx.RawData) (ok bool) { + r.(*mqlAwsDynamodbTable).Status, ok = plugin.RawToTValue[string](v.Value, v.Error) + return + }, "aws.rds.__id": func(r plugin.Resource, v *llx.RawData) (ok bool) { r.(*mqlAwsRds).__id, ok = v.Value.(string) return @@ -8295,6 +8379,7 @@ type mqlAwsVpcRoutetable struct { // optional: if you define mqlAwsVpcRoutetableInternal it will be used here Id plugin.TValue[string] Routes plugin.TValue[[]interface{}] + Tags plugin.TValue[map[string]interface{}] } // createAwsVpcRoutetable creates a new instance of this resource @@ -8342,6 +8427,10 @@ func (c *mqlAwsVpcRoutetable) GetRoutes() *plugin.TValue[[]interface{}] { return &c.Routes } +func (c *mqlAwsVpcRoutetable) GetTags() *plugin.TValue[map[string]interface{}] { + return &c.Tags +} + // mqlAwsVpcSubnet for the aws.vpc.subnet resource type mqlAwsVpcSubnet struct { MqlRuntime *plugin.Runtime @@ -8353,6 +8442,8 @@ type mqlAwsVpcSubnet struct { MapPublicIpOnLaunch plugin.TValue[bool] AvailabilityZone plugin.TValue[string] DefaultForAvailabilityZone plugin.TValue[bool] + AssignIpv6AddressOnCreation plugin.TValue[bool] + State plugin.TValue[string] } // createAwsVpcSubnet creates a new instance of this resource @@ -8416,6 +8507,14 @@ func (c *mqlAwsVpcSubnet) GetDefaultForAvailabilityZone() *plugin.TValue[bool] { return &c.DefaultForAvailabilityZone } +func (c *mqlAwsVpcSubnet) GetAssignIpv6AddressOnCreation() *plugin.TValue[bool] { + return &c.AssignIpv6AddressOnCreation +} + +func (c *mqlAwsVpcSubnet) GetState() *plugin.TValue[string] { + return &c.State +} + // mqlAwsVpcEndpoint for the aws.vpc.endpoint resource type mqlAwsVpcEndpoint struct { MqlRuntime *plugin.Runtime @@ -8428,6 +8527,9 @@ type mqlAwsVpcEndpoint struct { ServiceName plugin.TValue[string] PolicyDocument plugin.TValue[string] Subnets plugin.TValue[[]interface{}] + PrivateDnsEnabled plugin.TValue[bool] + State plugin.TValue[string] + CreatedAt plugin.TValue[*time.Time] } // createAwsVpcEndpoint creates a new instance of this resource @@ -8495,6 +8597,18 @@ func (c *mqlAwsVpcEndpoint) GetSubnets() *plugin.TValue[[]interface{}] { return &c.Subnets } +func (c *mqlAwsVpcEndpoint) GetPrivateDnsEnabled() *plugin.TValue[bool] { + return &c.PrivateDnsEnabled +} + +func (c *mqlAwsVpcEndpoint) GetState() *plugin.TValue[string] { + return &c.State +} + +func (c *mqlAwsVpcEndpoint) GetCreatedAt() *plugin.TValue[*time.Time] { + return &c.CreatedAt +} + // mqlAwsVpcFlowlog for the aws.vpc.flowlog resource type mqlAwsVpcFlowlog struct { MqlRuntime *plugin.Runtime @@ -8505,6 +8619,10 @@ type mqlAwsVpcFlowlog struct { Region plugin.TValue[string] Status plugin.TValue[string] Tags plugin.TValue[map[string]interface{}] + CreatedAt plugin.TValue[*time.Time] + Destination plugin.TValue[string] + MaxAggregationInterval plugin.TValue[int64] + TrafficType plugin.TValue[string] } // createAwsVpcFlowlog creates a new instance of this resource @@ -8559,6 +8677,22 @@ func (c *mqlAwsVpcFlowlog) GetTags() *plugin.TValue[map[string]interface{}] { return &c.Tags } +func (c *mqlAwsVpcFlowlog) GetCreatedAt() *plugin.TValue[*time.Time] { + return &c.CreatedAt +} + +func (c *mqlAwsVpcFlowlog) GetDestination() *plugin.TValue[string] { + return &c.Destination +} + +func (c *mqlAwsVpcFlowlog) GetMaxAggregationInterval() *plugin.TValue[int64] { + return &c.MaxAggregationInterval +} + +func (c *mqlAwsVpcFlowlog) GetTrafficType() *plugin.TValue[string] { + return &c.TrafficType +} + // mqlAwsWaf for the aws.waf resource type mqlAwsWaf struct { MqlRuntime *plugin.Runtime @@ -17016,6 +17150,8 @@ type mqlAwsDynamodbTable struct { DeletionProtectionEnabled plugin.TValue[bool] GlobalTableVersion plugin.TValue[string] Id plugin.TValue[string] + SizeBytes plugin.TValue[int64] + Status plugin.TValue[string] } // createAwsDynamodbTable creates a new instance of this resource @@ -17109,6 +17245,14 @@ func (c *mqlAwsDynamodbTable) GetId() *plugin.TValue[string] { return &c.Id } +func (c *mqlAwsDynamodbTable) GetSizeBytes() *plugin.TValue[int64] { + return &c.SizeBytes +} + +func (c *mqlAwsDynamodbTable) GetStatus() *plugin.TValue[string] { + return &c.Status +} + // mqlAwsRds for the aws.rds resource type mqlAwsRds struct { MqlRuntime *plugin.Runtime diff --git a/providers/aws/resources/aws.lr.manifest.yaml b/providers/aws/resources/aws.lr.manifest.yaml index d23e6a827d..39b6420567 100755 --- a/providers/aws/resources/aws.lr.manifest.yaml +++ b/providers/aws/resources/aws.lr.manifest.yaml @@ -801,7 +801,11 @@ resources: name: {} provisionedThroughput: {} region: {} + sizeBytes: + min_mondoo_version: 9.0.0 sseDescription: {} + status: + min_mondoo_version: 9.0.0 tags: min_mondoo_version: 5.16.0 is_private: true @@ -2370,10 +2374,16 @@ resources: - aws aws.vpc.endpoint: fields: + createdAt: + min_mondoo_version: 9.0.0 id: {} policyDocument: {} + privateDnsEnabled: + min_mondoo_version: 9.0.0 region: {} serviceName: {} + state: + min_mondoo_version: 9.0.0 subnets: {} type: {} vpc: {} @@ -2384,10 +2394,18 @@ resources: - aws aws.vpc.flowlog: fields: + createdAt: + min_mondoo_version: 9.0.0 + destination: + min_mondoo_version: 9.0.0 id: {} + maxAggregationInterval: + min_mondoo_version: 9.0.0 region: {} status: {} tags: {} + trafficType: + min_mondoo_version: 9.0.0 vpc: {} is_private: true min_mondoo_version: 5.15.0 @@ -2398,6 +2416,8 @@ resources: fields: id: {} routes: {} + tags: + min_mondoo_version: 9.0.0 is_private: true min_mondoo_version: 5.15.0 platform: @@ -2406,6 +2426,8 @@ resources: aws.vpc.subnet: fields: arn: {} + assignIpv6AddressOnCreation: + min_mondoo_version: 9.0.0 availabilityZone: min_mondoo_version: latest cidrs: {} @@ -2413,6 +2435,8 @@ resources: min_mondoo_version: latest id: {} mapPublicIpOnLaunch: {} + state: + min_mondoo_version: 9.0.0 is_private: true min_mondoo_version: 9.0.0 platform: diff --git a/providers/aws/resources/aws_dynamodb.go b/providers/aws/resources/aws_dynamodb.go index e7fae70ecb..ba37c12a68 100644 --- a/providers/aws/resources/aws_dynamodb.go +++ b/providers/aws/resources/aws_dynamodb.go @@ -302,6 +302,8 @@ func (a *mqlAwsDynamodb) getTables(conn *connection.AwsConnection) []*jobpool.Jo "deletionProtectionEnabled": llx.BoolDataPtr(table.Table.DeletionProtectionEnabled), "globalTableVersion": llx.StringDataPtr(table.Table.GlobalTableVersion), "id": llx.StringDataPtr(table.Table.TableId), + "sizeBytes": llx.IntDataPtr(table.Table.TableSizeBytes), + "status": llx.StringData(string(table.Table.TableStatus)), }) if err != nil { return nil, err diff --git a/providers/aws/resources/aws_vpc.go b/providers/aws/resources/aws_vpc.go index 39fa93dd7a..b1f6deedbd 100644 --- a/providers/aws/resources/aws_vpc.go +++ b/providers/aws/resources/aws_vpc.go @@ -133,13 +133,16 @@ func (a *mqlAwsVpc) endpoints() ([]interface{}, error) { } mqlEndpoint, err := CreateResource(a.MqlRuntime, "aws.vpc.endpoint", map[string]*llx.RawData{ - "id": llx.StringData(fmt.Sprintf("%s/%s", a.Region.Data, *endpoint.VpcEndpointId)), - "type": llx.StringData(string(endpoint.VpcEndpointType)), - "vpc": llx.StringData(*endpoint.VpcId), - "region": llx.StringData(a.Region.Data), - "serviceName": llx.StringData(*endpoint.ServiceName), - "policyDocument": llx.StringData(*endpoint.PolicyDocument), - "subnets": llx.ArrayData(subnetIds, types.String), + "id": llx.StringData(fmt.Sprintf("%s/%s", a.Region.Data, *endpoint.VpcEndpointId)), + "policyDocument": llx.StringDataPtr(endpoint.PolicyDocument), + "privateDnsEnabled": llx.BoolDataPtr(endpoint.PrivateDnsEnabled), + "region": llx.StringData(a.Region.Data), + "serviceName": llx.StringDataPtr(endpoint.ServiceName), + "state": llx.StringData(string(endpoint.State)), + "subnets": llx.ArrayData(subnetIds, types.String), + "type": llx.StringData(string(endpoint.VpcEndpointType)), + "vpc": llx.StringDataPtr(endpoint.VpcId), + "createdAt": llx.TimeDataPtr(endpoint.CreationTimestamp), }, ) if err != nil { @@ -174,11 +177,15 @@ func (a *mqlAwsVpc) flowLogs() ([]interface{}, error) { for _, flowLog := range flowLogsRes.FlowLogs { mqlFlowLog, err := CreateResource(a.MqlRuntime, "aws.vpc.flowlog", map[string]*llx.RawData{ - "id": llx.StringDataPtr(flowLog.FlowLogId), - "vpc": llx.StringData(vpc), - "region": llx.StringData(a.Region.Data), - "status": llx.StringDataPtr(flowLog.FlowLogStatus), - "tags": llx.MapData(Ec2TagsToMap(flowLog.Tags), types.String), + "createdAt": llx.TimeDataPtr(flowLog.CreationTime), + "destination": llx.StringDataPtr(flowLog.LogDestination), + "id": llx.StringDataPtr(flowLog.FlowLogId), + "maxAggregationInterval": llx.IntData(convert.ToInt64From32(flowLog.MaxAggregationInterval)), + "region": llx.StringData(a.Region.Data), + "status": llx.StringDataPtr(flowLog.FlowLogStatus), + "tags": llx.MapData(Ec2TagsToMap(flowLog.Tags), types.String), + "trafficType": llx.StringData(string(flowLog.TrafficType)), + "vpc": llx.StringData(vpc), }, ) if err != nil { @@ -224,6 +231,7 @@ func (a *mqlAwsVpc) routeTables() ([]interface{}, error) { map[string]*llx.RawData{ "id": llx.StringDataPtr(routeTable.RouteTableId), "routes": llx.ArrayData(dictRoutes, types.Any), + "tags": llx.MapData(Ec2TagsToMap(routeTable.Tags), types.String), }) if err != nil { return nil, err @@ -262,12 +270,14 @@ func (a *mqlAwsVpc) subnets() ([]interface{}, error) { for _, subnet := range subnets.Subnets { subnetResource, err := CreateResource(a.MqlRuntime, "aws.vpc.subnet", map[string]*llx.RawData{ - "arn": llx.StringData(fmt.Sprintf(subnetArnPattern, a.Region.Data, conn.AccountId(), convert.ToString(subnet.SubnetId))), - "id": llx.StringDataPtr(subnet.SubnetId), - "cidrs": llx.StringDataPtr(subnet.CidrBlock), - "mapPublicIpOnLaunch": llx.BoolDataPtr(subnet.MapPublicIpOnLaunch), - "availabilityZone": llx.StringDataPtr(subnet.AvailabilityZone), - "defaultForAvailabilityZone": llx.BoolDataPtr(subnet.DefaultForAz), + "arn": llx.StringData(fmt.Sprintf(subnetArnPattern, a.Region.Data, conn.AccountId(), convert.ToString(subnet.SubnetId))), + "assignIpv6AddressOnCreation": llx.BoolDataPtr(subnet.AssignIpv6AddressOnCreation), + "availabilityZone": llx.StringDataPtr(subnet.AvailabilityZone), + "cidrs": llx.StringDataPtr(subnet.CidrBlock), + "defaultForAvailabilityZone": llx.BoolDataPtr(subnet.DefaultForAz), + "id": llx.StringDataPtr(subnet.SubnetId), + "mapPublicIpOnLaunch": llx.BoolDataPtr(subnet.MapPublicIpOnLaunch), + "state": llx.StringData(string(subnet.State)), }) if err != nil { return nil, err