diff --git a/go.mod b/go.mod index 19bb1636..7e541e73 100755 --- a/go.mod +++ b/go.mod @@ -142,7 +142,7 @@ require ( github.com/hashicorp/go-hclog v1.6.3 github.com/nats-io/nats.go v1.36.0 github.com/opengovern/og-aws-describer v0.60.0 - github.com/opengovern/og-util v1.0.6-0.20241108102418-e20a35efc8ca + github.com/opengovern/og-util v1.1.0 github.com/opengovern/opengovernance v0.434.62-feat-integrations-service.0 github.com/spf13/cobra v1.8.1 github.com/turbot/steampipe-plugin-sdk/v5 v5.10.1 diff --git a/go.sum b/go.sum index 9922dbda..789a5de1 100644 --- a/go.sum +++ b/go.sum @@ -975,6 +975,8 @@ github.com/opengovern/og-aws-describer v0.60.0 h1:Cl0a4KW8eV9gmtFyDbNRtfxR+jyRNk github.com/opengovern/og-aws-describer v0.60.0/go.mod h1:gHBFpQcnj1KAX/s6/PzitZxQ/5ockN7cjzaOdPoBYCs= github.com/opengovern/og-util v1.0.6-0.20241108102418-e20a35efc8ca h1:yeF0lhv15WWULbOb811lVAv/KTY5nfsA0dkzd4GODlk= github.com/opengovern/og-util v1.0.6-0.20241108102418-e20a35efc8ca/go.mod h1:7l7fNhK6uewIwA0cs7QagJuhjt/E6hEAC01SR8Y0kKk= +github.com/opengovern/og-util v1.1.0 h1:bV2XKX8aIpJGC2CR4kh9CU/rJWPQed76gtVXM2zBDXM= +github.com/opengovern/og-util v1.1.0/go.mod h1:dyn8rhmxq59o1jnbgGfmcUvW7iB/eN6OxoTUUx6jEHA= github.com/opengovern/opengovernance v0.434.62-feat-integrations-service.0 h1:DYxFV9K4IGm9xe5TpXMi8HAVEdlb4sYDKbBkRTgZRms= github.com/opengovern/opengovernance v0.434.62-feat-integrations-service.0/go.mod h1:ozdf1nCN4iXbHT+CzmgboQLd6aPE1coa09Ze599g9SE= github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ= diff --git a/pkg/describer/worker.go b/pkg/describer/worker.go index 698968ee..182ee0a9 100755 --- a/pkg/describer/worker.go +++ b/pkg/describer/worker.go @@ -147,17 +147,17 @@ func doDescribe( } rs.Send(&es.Resource{ - PlatformID: uuid.New().String(), - ResourceID: resource.UniqueID(), - ResourceName: resource.Name, - Description: description, - IntegrationType: configs.IntegrationName, - ResourceType: strings.ToLower(job.ResourceType), - IntegrationID: job.IntegrationID, - IntegrationMetadata: metadata, - CanonicalTags: newTags, - DescribedAt: job.DescribedAt, - DescribedBy: strconv.FormatUint(uint64(job.JobID), 10), + PlatformID: uuid.New().String(), + ResourceID: resource.UniqueID(), + ResourceName: resource.Name, + Description: description, + IntegrationType: configs.IntegrationName, + ResourceType: strings.ToLower(job.ResourceType), + IntegrationID: job.IntegrationID, + Metadata: metadata, + CanonicalTags: newTags, + DescribedAt: job.DescribedAt, + DescribedBy: strconv.FormatUint(uint64(job.JobID), 10), }) return nil } diff --git a/pkg/sdk/es/resources_clients.go b/pkg/sdk/es/resources_clients.go index b2dc690d..57f8d873 100644 --- a/pkg/sdk/es/resources_clients.go +++ b/pkg/sdk/es/resources_clients.go @@ -20,6 +20,7 @@ type AccessAnalyzerAnalyzer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AccessAnalyzerAnalyzerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -100,6 +101,7 @@ var listAccessAnalyzerAnalyzerFilters = map[string]string{ "last_resource_analyzed": "Description.Analyzer.LastResourceAnalyzed", "last_resource_analyzed_at": "Description.Analyzer.LastResourceAnalyzedAt", "name": "Description.Analyzer.Name", + "og_account_id": "metadata.IntegrationID", "status": "Description.Analyzer.Status", "status_reason": "Description.Analyzer.StatusReason", "tags": "Description.Analyzer.Tags", @@ -174,6 +176,7 @@ var getAccessAnalyzerAnalyzerFilters = map[string]string{ "last_resource_analyzed": "Description.Analyzer.LastResourceAnalyzed", "last_resource_analyzed_at": "Description.Analyzer.LastResourceAnalyzedAt", "name": "description.Analyzer.Name", + "og_account_id": "metadata.IntegrationID", "status": "Description.Analyzer.Status", "status_reason": "Description.Analyzer.StatusReason", "tags": "Description.Analyzer.Tags", @@ -242,6 +245,7 @@ type AccessAnalyzerAnalyzerFinding struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AccessAnalyzerAnalyzerFindingDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -474,6 +478,7 @@ type ApiGatewayStage struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayStageDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -562,6 +567,7 @@ var listApiGatewayStageFilters = map[string]string{ "last_updated_date": "Description.Stage.LastUpdatedDate", "method_settings": "Description.Stage.MethodSettings", "name": "Description.Stage.StageName", + "og_account_id": "metadata.IntegrationID", "rest_api_id": "Description.RestApiId", "tags": "Description.Stage.Tags", "title": "Description.Stage.StageName", @@ -645,6 +651,7 @@ var getApiGatewayStageFilters = map[string]string{ "last_updated_date": "Description.Stage.LastUpdatedDate", "method_settings": "Description.Stage.MethodSettings", "name": "description.Stage.StageName", + "og_account_id": "metadata.IntegrationID", "rest_api_id": "description.RestApiId", "tags": "Description.Stage.Tags", "title": "Description.Stage.StageName", @@ -714,6 +721,7 @@ type ApiGatewayV2Stage struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayV2StageDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -803,6 +811,7 @@ var listApiGatewayV2StageFilters = map[string]string{ "description": "Description.Stage.Description", "last_deployment_status_message": "Description.Stage.LastDeploymentStatusMessage", "last_updated_date": "Description.Stage.LastUpdatedDate", + "og_account_id": "metadata.IntegrationID", "stage_name": "Description.Stage.StageName", "stage_variables": "Description.Stage.StageVariables", "tags": "Description.Stage.Tags", @@ -886,6 +895,7 @@ var getApiGatewayV2StageFilters = map[string]string{ "last_deployment_status_message": "Description.Stage.LastDeploymentStatusMessage", "last_updated_date": "Description.Stage.LastUpdatedDate", "name": "description.Stage.StageName", + "og_account_id": "metadata.IntegrationID", "stage_name": "Description.Stage.StageName", "stage_variables": "Description.Stage.StageVariables", "tags": "Description.Stage.Tags", @@ -953,6 +963,7 @@ type ApiGatewayRestAPI struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayRestAPIDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -1036,6 +1047,7 @@ var listApiGatewayRestAPIFilters = map[string]string{ "endpoint_configuration_vpc_endpoint_ids": "Description.RestAPI.EndpointConfiguration.VpcEndpointIds", "minimum_compression_size": "Description.RestAPI.MinimumCompressionSize", "name": "Description.RestAPI.Name", + "og_account_id": "metadata.IntegrationID", "tags": "Description.RestAPI.Tags", "title": "Description.RestAPI.Name", "version": "Description.RestAPI.Version", @@ -1112,6 +1124,7 @@ var getApiGatewayRestAPIFilters = map[string]string{ "endpoint_configuration_vpc_endpoint_ids": "Description.RestAPI.EndpointConfiguration.VpcEndpointIds", "minimum_compression_size": "Description.RestAPI.MinimumCompressionSize", "name": "Description.RestAPI.Name", + "og_account_id": "metadata.IntegrationID", "tags": "Description.RestAPI.Tags", "title": "Description.RestAPI.Name", "version": "Description.RestAPI.Version", @@ -1179,6 +1192,7 @@ type ApiGatewayApiKey struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayApiKeyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -1260,6 +1274,7 @@ var listApiGatewayApiKeyFilters = map[string]string{ "id": "Description.ApiKey.Id", "last_updated_date": "Description.ApiKey.LastUpdatedDate", "name": "Description.ApiKey.Name", + "og_account_id": "metadata.IntegrationID", "tags_src": "Tags", "title": "Name", "value": "Description.ApiKey.Value", @@ -1333,6 +1348,7 @@ var getApiGatewayApiKeyFilters = map[string]string{ "id": "description.ApiKey.Id", "last_updated_date": "Description.ApiKey.LastUpdatedDate", "name": "Description.ApiKey.Name", + "og_account_id": "metadata.IntegrationID", "tags_src": "Tags", "title": "Name", "value": "Description.ApiKey.Value", @@ -1399,6 +1415,7 @@ type ApiGatewayUsagePlan struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayUsagePlanDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -1473,15 +1490,16 @@ func (p ApiGatewayUsagePlanPaginator) NextPage(ctx context.Context) ([]ApiGatewa } var listApiGatewayUsagePlanFilters = map[string]string{ - "api_stages": "Description.UsagePlan.ApiStages", - "description": "Description.UsagePlan.Description", - "id": "Description.UsagePlan.Id", - "name": "Description.UsagePlan.Name", - "product_code": "Description.UsagePlan.ProductCode", - "quota": "Description.UsagePlan.Quota", - "tags": "Description.UsagePlan.Tags", - "throttle": "Description.UsagePlan.Throttle", - "title": "Description.UsagePlan.Name", + "api_stages": "Description.UsagePlan.ApiStages", + "description": "Description.UsagePlan.Description", + "id": "Description.UsagePlan.Id", + "name": "Description.UsagePlan.Name", + "og_account_id": "metadata.IntegrationID", + "product_code": "Description.UsagePlan.ProductCode", + "quota": "Description.UsagePlan.Quota", + "tags": "Description.UsagePlan.Tags", + "throttle": "Description.UsagePlan.Throttle", + "title": "Description.UsagePlan.Name", } func ListApiGatewayUsagePlan(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -1545,15 +1563,16 @@ func ListApiGatewayUsagePlan(ctx context.Context, d *plugin.QueryData, _ *plugin } var getApiGatewayUsagePlanFilters = map[string]string{ - "api_stages": "Description.UsagePlan.ApiStages", - "description": "Description.UsagePlan.Description", - "id": "description.UsagePlan.Id", - "name": "Description.UsagePlan.Name", - "product_code": "Description.UsagePlan.ProductCode", - "quota": "Description.UsagePlan.Quota", - "tags": "Description.UsagePlan.Tags", - "throttle": "Description.UsagePlan.Throttle", - "title": "Description.UsagePlan.Name", + "api_stages": "Description.UsagePlan.ApiStages", + "description": "Description.UsagePlan.Description", + "id": "description.UsagePlan.Id", + "name": "Description.UsagePlan.Name", + "og_account_id": "metadata.IntegrationID", + "product_code": "Description.UsagePlan.ProductCode", + "quota": "Description.UsagePlan.Quota", + "tags": "Description.UsagePlan.Tags", + "throttle": "Description.UsagePlan.Throttle", + "title": "Description.UsagePlan.Name", } func GetApiGatewayUsagePlan(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -1617,6 +1636,7 @@ type ApiGatewayAuthorizer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayAuthorizerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -1698,6 +1718,7 @@ var listApiGatewayAuthorizerFilters = map[string]string{ "identity_source": "Description.Authorizer.IdentitySource", "identity_validation_expression": "Description.Authorizer.IdentityValidationExpression", "name": "Description.Authorizer.Name", + "og_account_id": "metadata.IntegrationID", "provider_arns": "Description.Authorizer.ProviderARNs", "rest_api_id": "Description.RestApiId", "title": "Description.Authorizer.Name", @@ -1771,6 +1792,7 @@ var getApiGatewayAuthorizerFilters = map[string]string{ "identity_source": "Description.Authorizer.IdentitySource", "identity_validation_expression": "Description.Authorizer.IdentityValidationExpression", "name": "Description.Authorizer.Name", + "og_account_id": "metadata.IntegrationID", "provider_arns": "Description.Authorizer.ProviderARNs", "rest_api_id": "description.RestApiId", "title": "Description.Authorizer.Name", @@ -1837,6 +1859,7 @@ type ApiGatewayV2API struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayV2APIDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -1917,6 +1940,7 @@ var listApiGatewayV2APIFilters = map[string]string{ "created_date": "Description.API.CreatedDate", "disable_execute_api_endpoint": "Description.API.DisableExecuteApiEndpoint", "name": "Description.API.Name", + "og_account_id": "metadata.IntegrationID", "protocol_type": "Description.API.ProtocolType", "route_selection_expression": "Description.API.RouteSelectionExpression", "tags": "Description.API.Tags", @@ -1990,6 +2014,7 @@ var getApiGatewayV2APIFilters = map[string]string{ "created_date": "Description.API.CreatedDate", "disable_execute_api_endpoint": "Description.API.DisableExecuteApiEndpoint", "name": "Description.API.Name", + "og_account_id": "metadata.IntegrationID", "protocol_type": "Description.API.ProtocolType", "route_selection_expression": "Description.API.RouteSelectionExpression", "tags": "Description.API.Tags", @@ -2057,6 +2082,7 @@ type ApiGatewayV2DomainName struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayV2DomainNameDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -2135,6 +2161,7 @@ var listApiGatewayV2DomainNameFilters = map[string]string{ "domain_name": "Description.DomainName.DomainName", "domain_name_configurations": "Description.DomainName.DomainNameConfigurations", "mutual_tls_authentication": "Description.DomainName.MutualTlsAuthentication", + "og_account_id": "metadata.IntegrationID", "tags": "Description.DomainName.Tags", "title": "Description.DomainName.DomainName", } @@ -2204,6 +2231,7 @@ var getApiGatewayV2DomainNameFilters = map[string]string{ "domain_name": "description.DomainName.DomainName", "domain_name_configurations": "Description.DomainName.DomainNameConfigurations", "mutual_tls_authentication": "Description.DomainName.MutualTlsAuthentication", + "og_account_id": "metadata.IntegrationID", "tags": "Description.DomainName.Tags", "title": "Description.DomainName.DomainName", } @@ -2269,6 +2297,7 @@ type ApiGatewayDomainName struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayDomainNameDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -2343,7 +2372,8 @@ func (p ApiGatewayDomainNamePaginator) NextPage(ctx context.Context) ([]ApiGatew } var listApiGatewayDomainNameFilters = map[string]string{ - "title": "DomainName", + "og_account_id": "metadata.IntegrationID", + "title": "DomainName", } func ListApiGatewayDomainName(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -2407,8 +2437,9 @@ func ListApiGatewayDomainName(ctx context.Context, d *plugin.QueryData, _ *plugi } var getApiGatewayDomainNameFilters = map[string]string{ - "domain_name": "description.DomainName.DomainName", - "title": "DomainName", + "domain_name": "description.DomainName.DomainName", + "og_account_id": "metadata.IntegrationID", + "title": "DomainName", } func GetApiGatewayDomainName(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -2472,6 +2503,7 @@ type ApiGatewayV2Route struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayV2RouteDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -2552,6 +2584,7 @@ var listApiGatewayV2RouteFilters = map[string]string{ "authorization_type": "Description.Route.AuthorizationType", "authorizer_id": "Description.Route.AuthorizerId", "model_selection_expression": "Description.Route.ModelSelectionExpression", + "og_account_id": "metadata.IntegrationID", "operation_name": "Description.Route.OperationName", "request_models": "Description.Route.RequestModels", "request_parameters": "Description.Route.RequestParameters", @@ -2630,6 +2663,7 @@ var getApiGatewayV2RouteFilters = map[string]string{ "authorizer_id": "Description.Route.AuthorizerId", "domain_name": "description.DomainName.DomainName", "model_selection_expression": "Description.Route.ModelSelectionExpression", + "og_account_id": "metadata.IntegrationID", "operation_name": "Description.Route.OperationName", "request_models": "Description.Route.RequestModels", "request_parameters": "Description.Route.RequestParameters", @@ -2701,6 +2735,7 @@ type ApiGatewayV2Integration struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApiGatewayV2IntegrationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -2788,6 +2823,7 @@ var listApiGatewayV2IntegrationFilters = map[string]string{ "integration_subtype": "Description.Integration.IntegrationSubtype", "integration_type": "Description.Integration.IntegrationType", "integration_uri": "Description.Integration.IntegrationUri", + "og_account_id": "metadata.IntegrationID", "passthrough_behavior": "Description.Integration.PassthroughBehavior", "payload_format_version": "Description.Integration.PayloadFormatVersion", "request_parameters": "Description.Integration.RequestParameters", @@ -2873,6 +2909,7 @@ var getApiGatewayV2IntegrationFilters = map[string]string{ "integration_subtype": "Description.Integration.IntegrationSubtype", "integration_type": "Description.Integration.IntegrationType", "integration_uri": "Description.Integration.IntegrationUri", + "og_account_id": "metadata.IntegrationID", "passthrough_behavior": "Description.Integration.PassthroughBehavior", "payload_format_version": "Description.Integration.PayloadFormatVersion", "request_parameters": "Description.Integration.RequestParameters", @@ -2945,6 +2982,7 @@ type ElasticBeanstalkEnvironment struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticBeanstalkEnvironmentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -3034,6 +3072,7 @@ var listElasticBeanstalkEnvironmentFilters = map[string]string{ "health": "Description.EnvironmentDescription.Health", "health_status": "Description.EnvironmentDescription.HealthStatus", "managed_actions": "Description.ManagedAction", + "og_account_id": "metadata.IntegrationID", "operations_role": "Description.EnvironmentDescription.OperationsRole", "platform_arn": "Description.EnvironmentDescription.PlatformArn", "resources": "Description.EnvironmentDescription.Resources", @@ -3122,6 +3161,7 @@ var getElasticBeanstalkEnvironmentFilters = map[string]string{ "health": "Description.EnvironmentDescription.Health", "health_status": "Description.EnvironmentDescription.HealthStatus", "managed_actions": "Description.ManagedAction", + "og_account_id": "metadata.IntegrationID", "operations_role": "Description.EnvironmentDescription.OperationsRole", "platform_arn": "Description.EnvironmentDescription.PlatformArn", "resources": "Description.EnvironmentDescription.Resources", @@ -3195,6 +3235,7 @@ type ElasticBeanstalkApplication struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticBeanstalkApplicationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -3275,6 +3316,7 @@ var listElasticBeanstalkApplicationFilters = map[string]string{ "date_updated": "Description.Application.DateUpdated", "description": "Description.Application.Description", "name": "Description.Application.ApplicationName", + "og_account_id": "metadata.IntegrationID", "resource_lifecycle_config": "Description.Application.ResourceLifecycleConfig", "tags_src": "Description.Tags", "title": "Description.Application.ApplicationName", @@ -3348,6 +3390,7 @@ var getElasticBeanstalkApplicationFilters = map[string]string{ "date_updated": "Description.Application.DateUpdated", "description": "Description.Application.Description", "name": "description.Application.ApplicationName", + "og_account_id": "metadata.IntegrationID", "resource_lifecycle_config": "Description.Application.ResourceLifecycleConfig", "tags_src": "Description.Tags", "title": "Description.Application.ApplicationName", @@ -3415,6 +3458,7 @@ type ElasticBeanstalkApplicationVersion struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticBeanstalkApplicationVersionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -3639,6 +3683,7 @@ type ElastiCacheReplicationGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElastiCacheReplicationGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -3728,6 +3773,7 @@ var listElastiCacheReplicationGroupFilters = map[string]string{ "member_clusters_outpost_arns": "Description.ReplicationGroup.MemberClustersOutpostArns", "multi_az": "Description.ReplicationGroup.MultiAZ", "node_groups": "Description.ReplicationGroup.NodeGroups", + "og_account_id": "metadata.IntegrationID", "pending_modified_values": "Description.ReplicationGroup.PendingModifiedValues", "replication_group_id": "Description.ReplicationGroup.ReplicationGroupId", "snapshot_retention_limit": "Description.ReplicationGroup.SnapshotRetentionLimit", @@ -3815,6 +3861,7 @@ var getElastiCacheReplicationGroupFilters = map[string]string{ "member_clusters_outpost_arns": "Description.ReplicationGroup.MemberClustersOutpostArns", "multi_az": "Description.ReplicationGroup.MultiAZ", "node_groups": "Description.ReplicationGroup.NodeGroups", + "og_account_id": "metadata.IntegrationID", "pending_modified_values": "Description.ReplicationGroup.PendingModifiedValues", "replication_group_id": "description.ReplicationGroup.ReplicationGroupId", "snapshot_retention_limit": "Description.ReplicationGroup.SnapshotRetentionLimit", @@ -3887,6 +3934,7 @@ type ElastiCacheCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElastiCacheClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -3983,6 +4031,7 @@ var listElastiCacheClusterFilters = map[string]string{ "network_type": "Description.Cluster.NetworkType", "notification_configuration": "Description.Cluster.NotificationConfiguration", "num_cache_nodes": "Description.Cluster.NumCacheNodes", + "og_account_id": "metadata.IntegrationID", "pending_modified_values": "Description.Cluster.PendingModifiedValues", "preferred_availability_zone": "Description.Cluster.PreferredAvailabilityZone", "preferred_maintenance_window": "Description.Cluster.PreferredMaintenanceWindow", @@ -4081,6 +4130,7 @@ var getElastiCacheClusterFilters = map[string]string{ "network_type": "Description.Cluster.NetworkType", "notification_configuration": "Description.Cluster.NotificationConfiguration", "num_cache_nodes": "Description.Cluster.NumCacheNodes", + "og_account_id": "metadata.IntegrationID", "pending_modified_values": "Description.Cluster.PendingModifiedValues", "preferred_availability_zone": "Description.Cluster.PreferredAvailabilityZone", "preferred_maintenance_window": "Description.Cluster.PreferredMaintenanceWindow", @@ -4157,6 +4207,7 @@ type ElastiCacheParameterGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElastiCacheParameterGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -4235,6 +4286,7 @@ var listElastiCacheParameterGroupFilters = map[string]string{ "cache_parameter_group_name": "Description.ParameterGroup.CacheParameterGroupName", "description": "Description.ParameterGroup.Description", "is_global": "Description.ParameterGroup.IsGlobal", + "og_account_id": "metadata.IntegrationID", "title": "Description.ParameterGroup.CacheParameterGroupName", } @@ -4303,6 +4355,7 @@ var getElastiCacheParameterGroupFilters = map[string]string{ "cache_parameter_group_name": "description.ParameterGroup.CacheParameterGroupName", "description": "Description.ParameterGroup.Description", "is_global": "Description.ParameterGroup.IsGlobal", + "og_account_id": "metadata.IntegrationID", "title": "Description.ParameterGroup.CacheParameterGroupName", } @@ -4367,6 +4420,7 @@ type ElastiCacheReservedCacheNode struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElastiCacheReservedCacheNodeDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -4447,6 +4501,7 @@ var listElastiCacheReservedCacheNodeFilters = map[string]string{ "duration": "description.ReservedCacheNode.Duration", "fixed_price": "Description.ReservedCacheNode.FixedPrice", "offering_type": "description.ReservedCacheNode.OfferingType", + "og_account_id": "metadata.IntegrationID", "product_description": "Description.ReservedCacheNode.ProductDescription", "recurring_charges": "Description.ReservedCacheNode.RecurringCharges", "reserved_cache_node_id": "Description.ReservedCacheNode.ReservedCacheNodeId", @@ -4524,6 +4579,7 @@ var getElastiCacheReservedCacheNodeFilters = map[string]string{ "duration": "Description.ReservedCacheNode.Duration", "fixed_price": "Description.ReservedCacheNode.FixedPrice", "offering_type": "Description.ReservedCacheNode.OfferingType", + "og_account_id": "metadata.IntegrationID", "product_description": "Description.ReservedCacheNode.ProductDescription", "recurring_charges": "Description.ReservedCacheNode.RecurringCharges", "reserved_cache_node_id": "description.ReservedCacheNode.ReservedCacheNodeId", @@ -4595,6 +4651,7 @@ type ElastiCacheSubnetGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElastiCacheSubnetGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -4672,6 +4729,7 @@ var listElastiCacheSubnetGroupFilters = map[string]string{ "arn": "Description.SubnetGroup.ARN", "cache_subnet_group_description": "Description.SubnetGroup.CacheSubnetGroupDescription", "cache_subnet_group_name": "Description.SubnetGroup.CacheSubnetGroupName", + "og_account_id": "metadata.IntegrationID", "subnets": "Description.SubnetGroup.Subnets", "title": "Description.SubnetGroup.CacheSubnetGroupName", "vpc_id": "Description.SubnetGroup.VpcId", @@ -4741,6 +4799,7 @@ var getElastiCacheSubnetGroupFilters = map[string]string{ "arn": "Description.SubnetGroup.ARN", "cache_subnet_group_description": "Description.SubnetGroup.CacheSubnetGroupDescription", "cache_subnet_group_name": "description.SubnetGroup.CacheSubnetGroupName", + "og_account_id": "metadata.IntegrationID", "subnets": "Description.SubnetGroup.Subnets", "title": "Description.SubnetGroup.CacheSubnetGroupName", "vpc_id": "Description.SubnetGroup.VpcId", @@ -4807,6 +4866,7 @@ type ESDomain struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ESDomainDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -4900,6 +4960,7 @@ var listESDomainFilters = map[string]string{ "endpoint": "Description.Domain.Endpoint", "endpoints": "Description.Domain.Endpoints", "log_publishing_options": "Description.Domain.LogPublishingOptions", + "og_account_id": "metadata.IntegrationID", "processing": "Description.Domain.Processing", "service_software_options": "Description.Domain.ServiceSoftwareOptions", "snapshot_options": "Description.Domain.SnapshotOptions", @@ -4989,6 +5050,7 @@ var getESDomainFilters = map[string]string{ "endpoint": "Description.Domain.Endpoint", "endpoints": "Description.Domain.Endpoints", "log_publishing_options": "Description.Domain.LogPublishingOptions", + "og_account_id": "metadata.IntegrationID", "processing": "Description.Domain.Processing", "service_software_options": "Description.Domain.ServiceSoftwareOptions", "snapshot_options": "Description.Domain.SnapshotOptions", @@ -5059,6 +5121,7 @@ type EMRCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EMRClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -5149,6 +5212,7 @@ var listEMRClusterFilters = map[string]string{ "master_public_dns_name": "Description.Cluster.MasterPublicDnsName", "name": "Description.Cluster.Name", "normalized_instance_hours": "Description.Cluster.NormalizedInstanceHours", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.Cluster.OutpostArn", "placement_groups": "Description.Cluster.PlacementGroups", "release_label": "Description.Cluster.ReleaseLabel", @@ -5244,6 +5308,7 @@ var getEMRClusterFilters = map[string]string{ "master_public_dns_name": "Description.Cluster.MasterPublicDnsName", "name": "Description.Cluster.Name", "normalized_instance_hours": "Description.Cluster.NormalizedInstanceHours", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.Cluster.OutpostArn", "placement_groups": "Description.Cluster.PlacementGroups", "release_label": "Description.Cluster.ReleaseLabel", @@ -5323,6 +5388,7 @@ type EMRInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EMRInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -5405,6 +5471,7 @@ var listEMRInstanceFilters = map[string]string{ "instance_group_id": "description.Instance.InstanceGroupId", "instance_type": "Description.Instance.InstanceType", "market": "Description.Instance.Market", + "og_account_id": "metadata.IntegrationID", "private_dns_name": "Description.Instance.PrivateDnsName", "private_ip_address": "Description.Instance.PrivateIpAddress", "public_dns_name": "Description.Instance.PublicDnsName", @@ -5484,6 +5551,7 @@ var getEMRInstanceFilters = map[string]string{ "instance_group_id": "Description.Instance.InstanceGroupId", "instance_type": "Description.Instance.InstanceType", "market": "Description.Instance.Market", + "og_account_id": "metadata.IntegrationID", "private_dns_name": "Description.Instance.PrivateDnsName", "private_ip_address": "Description.Instance.PrivateIpAddress", "public_dns_name": "Description.Instance.PublicDnsName", @@ -5555,6 +5623,7 @@ type EMRInstanceFleet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EMRInstanceFleetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -5635,6 +5704,7 @@ var listEMRInstanceFleetFilters = map[string]string{ "instance_type_specifications": "Description.InstanceFleet.InstanceTypeSpecifications", "launch_specifications": "Description.InstanceFleet.LaunchSpecifications", "name": "Description.InstanceFleet.Name", + "og_account_id": "metadata.IntegrationID", "provisioned_on_demand_capacity": "Description.InstanceFleet.ProvisionedOnDemandCapacity", "provisioned_spot_capacity": "Description.InstanceFleet.ProvisionedSpotCapacity", "state": "Description.InstanceFleet.Status.State", @@ -5711,6 +5781,7 @@ var getEMRInstanceFleetFilters = map[string]string{ "instance_type_specifications": "Description.InstanceFleet.InstanceTypeSpecifications", "launch_specifications": "Description.InstanceFleet.LaunchSpecifications", "name": "Description.InstanceFleet.Name", + "og_account_id": "metadata.IntegrationID", "provisioned_on_demand_capacity": "Description.InstanceFleet.ProvisionedOnDemandCapacity", "provisioned_spot_capacity": "Description.InstanceFleet.ProvisionedSpotCapacity", "state": "Description.InstanceFleet.Status.State", @@ -5781,6 +5852,7 @@ type EMRInstanceGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EMRInstanceGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -5870,6 +5942,7 @@ var listEMRInstanceGroupFilters = map[string]string{ "last_successfully_applied_configurations_version": "Description.InstanceGroup.LastSuccessfullyAppliedConfigurationsVersion", "market": "Description.InstanceGroup.Market", "name": "Description.InstanceGroup.Name", + "og_account_id": "metadata.IntegrationID", "requested_instance_count": "Description.InstanceGroup.RequestedInstanceCount", "running_instance_count": "Description.InstanceGroup.RunningInstanceCount", "shrink_policy": "Description.InstanceGroup.ShrinkPolicy", @@ -5954,6 +6027,7 @@ var getEMRInstanceGroupFilters = map[string]string{ "last_successfully_applied_configurations_version": "Description.InstanceGroup.LastSuccessfullyAppliedConfigurationsVersion", "market": "Description.InstanceGroup.Market", "name": "Description.InstanceGroup.Name", + "og_account_id": "metadata.IntegrationID", "requested_instance_count": "Description.InstanceGroup.RequestedInstanceCount", "running_instance_count": "Description.InstanceGroup.RunningInstanceCount", "shrink_policy": "Description.InstanceGroup.ShrinkPolicy", @@ -6023,6 +6097,7 @@ type EMRBlockPublicAccessConfiguration struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EMRBlockPublicAccessConfigurationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -6101,6 +6176,7 @@ var listEMRBlockPublicAccessConfigurationFilters = map[string]string{ "classification": "Description.Configuration.Classification", "created_by_arn": "Description.ConfigurationMetadata.CreatedByArn", "creation_date": "Description.ConfigurationMetadata.CreationDateTime", + "og_account_id": "metadata.IntegrationID", "permitted_public_security_group_rule_ranges": "Description.Configuration.PermittedPublicSecurityGroupRuleRanges", } @@ -6169,6 +6245,7 @@ var getEMRBlockPublicAccessConfigurationFilters = map[string]string{ "classification": "Description.Configuration.Classification", "created_by_arn": "Description.ConfigurationMetadata.CreatedByArn", "creation_date": "Description.ConfigurationMetadata.CreationDateTime", + "og_account_id": "metadata.IntegrationID", "permitted_public_security_group_rule_ranges": "Description.Configuration.PermittedPublicSecurityGroupRuleRanges", } @@ -6233,6 +6310,7 @@ type GuardDutyFinding struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GuardDutyFindingDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -6314,6 +6392,7 @@ var listGuardDutyFindingFilters = map[string]string{ "detector_id": "Description.Finding.Service.DetectorId", "id": "Description.Finding.Id", "name": "Description.Finding.Title", + "og_account_id": "metadata.IntegrationID", "resource": "Description.Finding.Resource", "schema_version": "Description.Finding.SchemaVersion", "service": "Description.Finding.Service", @@ -6391,6 +6470,7 @@ var getGuardDutyFindingFilters = map[string]string{ "detector_id": "Description.Finding.Service.DetectorId", "id": "Description.Finding.Id", "name": "Description.Finding.Title", + "og_account_id": "metadata.IntegrationID", "resource": "Description.Finding.Resource", "schema_version": "Description.Finding.SchemaVersion", "service": "Description.Finding.Service", @@ -6461,6 +6541,7 @@ type GuardDutyDetector struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GuardDutyDetectorDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -6541,6 +6622,7 @@ var listGuardDutyDetectorFilters = map[string]string{ "detector_id": "Description.DetectorId", "features": "Description.Detector.Features", "finding_publishing_frequency": "Description.Detector.FindingPublishingFrequency", + "og_account_id": "metadata.IntegrationID", "service_role": "Description.Detector.ServiceRole", "status": "Description.Detector.Status", "tags": "Description.Detector.Tags", @@ -6615,6 +6697,7 @@ var getGuardDutyDetectorFilters = map[string]string{ "detector_id": "description.DetectorId", "features": "Description.Detector.Features", "finding_publishing_frequency": "Description.Detector.FindingPublishingFrequency", + "og_account_id": "metadata.IntegrationID", "service_role": "Description.Detector.ServiceRole", "status": "Description.Detector.Status", "tags": "Description.Detector.Tags", @@ -6683,6 +6766,7 @@ type GuardDutyFilter struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GuardDutyFilterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -6762,6 +6846,7 @@ var listGuardDutyFilterFilters = map[string]string{ "detector_id": "description.DetectorId", "finding_criteria": "Description.Filter.FindingCriteria", "name": "Description.Filter.Name", + "og_account_id": "metadata.IntegrationID", "rank": "Description.Filter.Rank", "tags": "Description.Filter.Tags", "title": "Description.Filter.Name", @@ -6833,6 +6918,7 @@ var getGuardDutyFilterFilters = map[string]string{ "detector_id": "description.DetectorId", "finding_criteria": "Description.Filter.FindingCriteria", "name": "description.Filter.Name", + "og_account_id": "metadata.IntegrationID", "rank": "Description.Filter.Rank", "tags": "Description.Filter.Tags", "title": "Description.Filter.Name", @@ -6899,6 +6985,7 @@ type GuardDutyIPSet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GuardDutyIPSetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -6973,14 +7060,15 @@ func (p GuardDutyIPSetPaginator) NextPage(ctx context.Context) ([]GuardDutyIPSet } var listGuardDutyIPSetFilters = map[string]string{ - "detector_id": "description.DetectorId", - "format": "Description.IPSet.Format", - "ipset_id": "Description.IPSetId", - "location": "Description.IPSet.Location", - "name": "Description.IPSet.Name", - "status": "Description.IPSet.Status", - "tags": "Description.IPSet.Tags", - "title": "Description.IPSet.Name", + "detector_id": "description.DetectorId", + "format": "Description.IPSet.Format", + "ipset_id": "Description.IPSetId", + "location": "Description.IPSet.Location", + "name": "Description.IPSet.Name", + "og_account_id": "metadata.IntegrationID", + "status": "Description.IPSet.Status", + "tags": "Description.IPSet.Tags", + "title": "Description.IPSet.Name", } func ListGuardDutyIPSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -7044,14 +7132,15 @@ func ListGuardDutyIPSet(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr } var getGuardDutyIPSetFilters = map[string]string{ - "detector_id": "description.DetectorId", - "format": "Description.IPSet.Format", - "ipset_id": "description.IPSetId", - "location": "Description.IPSet.Location", - "name": "Description.IPSet.Name", - "status": "Description.IPSet.Status", - "tags": "Description.IPSet.Tags", - "title": "Description.IPSet.Name", + "detector_id": "description.DetectorId", + "format": "Description.IPSet.Format", + "ipset_id": "description.IPSetId", + "location": "Description.IPSet.Location", + "name": "Description.IPSet.Name", + "og_account_id": "metadata.IntegrationID", + "status": "Description.IPSet.Status", + "tags": "Description.IPSet.Tags", + "title": "Description.IPSet.Name", } func GetGuardDutyIPSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -7115,6 +7204,7 @@ type GuardDutyMember struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GuardDutyMemberDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -7194,6 +7284,7 @@ var listGuardDutyMemberFilters = map[string]string{ "invited_at": "Description.Member.InvitedAt", "master_id": "Description.Member.MasterId", "member_account_id": "Description.Member.AccountId", + "og_account_id": "metadata.IntegrationID", "relationship_status": "Description.Member.RelationshipStatus", "title": "Description.Member.AccountId", "updated_at": "Description.Member.UpdatedAt", @@ -7265,6 +7356,7 @@ var getGuardDutyMemberFilters = map[string]string{ "invited_at": "Description.Member.InvitedAt", "master_id": "Description.Member.MasterId", "member_account_id": "description.Member.AccountId", + "og_account_id": "metadata.IntegrationID", "relationship_status": "Description.Member.RelationshipStatus", "title": "Description.Member.AccountId", "updated_at": "Description.Member.UpdatedAt", @@ -7331,6 +7423,7 @@ type GuardDutyPublishingDestination struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GuardDutyPublishingDestinationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -7410,6 +7503,7 @@ var listGuardDutyPublishingDestinationFilters = map[string]string{ "destination_type": "Description.PublishingDestination.DestinationType", "detector_id": "description.DetectorId", "kms_key_arn": "Description.PublishingDestination.DestinationProperties.KmsKeyArn", + "og_account_id": "metadata.IntegrationID", "status": "Description.PublishingDestination.Status", "title": "Description.PublishingDestination.DestinationId", } @@ -7480,6 +7574,7 @@ var getGuardDutyPublishingDestinationFilters = map[string]string{ "destination_type": "Description.PublishingDestination.DestinationType", "detector_id": "description.DetectorId", "kms_key_arn": "Description.PublishingDestination.DestinationProperties.KmsKeyArn", + "og_account_id": "metadata.IntegrationID", "status": "Description.PublishingDestination.Status", "title": "Description.PublishingDestination.DestinationId", } @@ -7545,6 +7640,7 @@ type GuardDutyThreatIntelSet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GuardDutyThreatIntelSetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -7623,6 +7719,7 @@ var listGuardDutyThreatIntelSetFilters = map[string]string{ "format": "Description.ThreatIntelSet.Format", "location": "Description.ThreatIntelSet.Location", "name": "Description.ThreatIntelSet.Name", + "og_account_id": "metadata.IntegrationID", "status": "Description.ThreatIntelSet.Status", "tags": "Description.ThreatIntelSet.Tags", "threat_intel_set_id": "Description.ThreatIntelSetID", @@ -7694,6 +7791,7 @@ var getGuardDutyThreatIntelSetFilters = map[string]string{ "format": "Description.ThreatIntelSet.Format", "location": "Description.ThreatIntelSet.Location", "name": "Description.ThreatIntelSet.Name", + "og_account_id": "metadata.IntegrationID", "status": "Description.ThreatIntelSet.Status", "tags": "Description.ThreatIntelSet.Tags", "threat_intel_set_id": "description.ThreatIntelSetID", @@ -7761,6 +7859,7 @@ type BackupPlan struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupPlanDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -7844,6 +7943,7 @@ var listBackupPlanFilters = map[string]string{ "deletion_date": "Description.BackupPlan.DeletionDate", "last_execution_date": "Description.BackupPlan.LastExecutionDate", "name": "Description.BackupPlan.BackupPlanName", + "og_account_id": "metadata.IntegrationID", "rules": "Description.PlanDetails.Rules", "title": "Description.BackupPlan.BackupPlanName", "version_id": "Description.BackupPlan.VersionId", @@ -7919,6 +8019,7 @@ var getBackupPlanFilters = map[string]string{ "deletion_date": "Description.BackupPlan.DeletionDate", "last_execution_date": "Description.BackupPlan.LastExecutionDate", "name": "Description.BackupPlan.BackupPlanName", + "og_account_id": "metadata.IntegrationID", "rules": "Description.PlanDetails.Rules", "title": "Description.BackupPlan.BackupPlanName", "version_id": "Description.BackupPlan.VersionId", @@ -7985,6 +8086,7 @@ type BackupSelection struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupSelectionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -8065,6 +8167,7 @@ var listBackupSelectionFilters = map[string]string{ "creator_request_id": "Description.BackupSelection.CreatorRequestId", "iam_role_arn": "Description.BackupSelection.IamRoleArn", "list_of_tags": "Description.ListOfTags", + "og_account_id": "metadata.IntegrationID", "resources": "Description.Resources", "selection_id": "Description.BackupSelection.SelectionId", "selection_name": "Description.BackupSelection.SelectionName", @@ -8138,6 +8241,7 @@ var getBackupSelectionFilters = map[string]string{ "creator_request_id": "Description.BackupSelection.CreatorRequestId", "iam_role_arn": "Description.BackupSelection.IamRoleArn", "list_of_tags": "Description.ListOfTags", + "og_account_id": "metadata.IntegrationID", "resources": "Description.Resources", "selection_id": "description.BackupSelection.SelectionId", "selection_name": "Description.BackupSelection.SelectionName", @@ -8205,6 +8309,7 @@ type BackupVault struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupVaultDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -8286,6 +8391,7 @@ var listBackupVaultFilters = map[string]string{ "encryption_key_arn": "Description.BackupVault.EncryptionKeyArn", "name": "Description.BackupVault.BackupVaultName", "number_of_recovery_points": "Description.BackupVault.NumberOfRecoveryPoints", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "sns_topic_arn": "Description.SNSTopicArn", "tags": "Description.Tags", @@ -8360,6 +8466,7 @@ var getBackupVaultFilters = map[string]string{ "encryption_key_arn": "Description.BackupVault.EncryptionKeyArn", "name": "description.BackupVault.BackupVaultName", "number_of_recovery_points": "Description.BackupVault.NumberOfRecoveryPoints", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "sns_topic_arn": "Description.SNSTopicArn", "tags": "Description.Tags", @@ -8427,6 +8534,7 @@ type BackupRecoveryPoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupRecoveryPointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -8513,6 +8621,7 @@ var listBackupRecoveryPointFilters = map[string]string{ "is_encrypted": "Description.RecoveryPoint.IsEncrypted", "last_restore_time": "Description.RecoveryPoint.LastRestoreTime", "lifecycle": "Description.RecoveryPoint.Lifecycle", + "og_account_id": "metadata.IntegrationID", "recovery_point_arn": "description.RecoveryPoint.RecoveryPointArn", "resource_arn": "Description.RecoveryPoint.ResourceArn", "resource_type": "description.RecoveryPoint.ResourceType", @@ -8596,6 +8705,7 @@ var getBackupRecoveryPointFilters = map[string]string{ "is_encrypted": "Description.RecoveryPoint.IsEncrypted", "last_restore_time": "Description.RecoveryPoint.LastRestoreTime", "lifecycle": "Description.RecoveryPoint.Lifecycle", + "og_account_id": "metadata.IntegrationID", "recovery_point_arn": "description.RecoveryPoint.RecoveryPointArn", "resource_arn": "Description.RecoveryPoint.ResourceArn", "resource_type": "Description.RecoveryPoint.ResourceType", @@ -8667,6 +8777,7 @@ type BackupProtectedResource struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupProtectedResourceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -8742,6 +8853,7 @@ func (p BackupProtectedResourcePaginator) NextPage(ctx context.Context) ([]Backu var listBackupProtectedResourceFilters = map[string]string{ "last_backup_time": "Description.ProtectedResource.LastBackupTime", + "og_account_id": "metadata.IntegrationID", "resource_arn": "Description.ProtectedResource.ResourceArn", "resource_type": "Description.ProtectedResource.ResourceType", } @@ -8808,6 +8920,7 @@ func ListBackupProtectedResource(ctx context.Context, d *plugin.QueryData, _ *pl var getBackupProtectedResourceFilters = map[string]string{ "last_backup_time": "Description.ProtectedResource.LastBackupTime", + "og_account_id": "metadata.IntegrationID", "resource_arn": "description.ProtectedResource.ResourceArn", "resource_type": "Description.ProtectedResource.ResourceType", } @@ -8873,6 +8986,7 @@ type BackupFramework struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupFrameworkDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -8954,6 +9068,7 @@ var listBackupFrameworkFilters = map[string]string{ "framework_description": "Description.Framework.FrameworkDescription", "framework_name": "Description.Framework.FrameworkName", "framework_status": "Description.Framework.FrameworkStatus", + "og_account_id": "metadata.IntegrationID", "tags": "Description.Tags", "title": "Description.Framework.FrameworkName", } @@ -9026,6 +9141,7 @@ var getBackupFrameworkFilters = map[string]string{ "framework_description": "Description.Framework.FrameworkDescription", "framework_name": "description.Framework.FrameworkName", "framework_status": "Description.Framework.FrameworkStatus", + "og_account_id": "metadata.IntegrationID", "tags": "Description.Tags", "title": "Description.Framework.FrameworkName", } @@ -9091,6 +9207,7 @@ type BackupLegalHold struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupLegalHoldDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -9170,6 +9287,7 @@ var listBackupLegalHoldFilters = map[string]string{ "creation_date": "Description.LegalHold.CreationDate", "description": "Description.LegalHold.Description", "legal_hold_id": "Description.LegalHold.LegalHoldId", + "og_account_id": "metadata.IntegrationID", "recovery_point_selection": "Description.LegalHold.RecoveryPointSelection", "retain_record_until": "Description.LegalHold.RetainRecordUntil", "status": "Description.LegalHold.Status", @@ -9242,6 +9360,7 @@ var getBackupLegalHoldFilters = map[string]string{ "creation_date": "Description.LegalHold.CreationDate", "description": "Description.LegalHold.Description", "legal_hold_id": "description.Framework.LegalHoldId", + "og_account_id": "metadata.IntegrationID", "recovery_point_selection": "Description.LegalHold.RecoveryPointSelection", "retain_record_until": "Description.LegalHold.RetainRecordUntil", "status": "Description.LegalHold.Status", @@ -9309,6 +9428,7 @@ type BackupReportPlan struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupReportPlanDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -9389,6 +9509,7 @@ var listBackupReportPlanFilters = map[string]string{ "description": "Description.ReportPlan.ReportPlanDescription", "last_attempted_execution_time": "Description.ReportPlan.LastAttemptedExecutionTime", "last_successful_execution_time": "Description.ReportPlan.LastSuccessfulExecutionTime", + "og_account_id": "metadata.IntegrationID", "report_delivery_channel": "Description.ReportPlan.ReportDeliveryChannel", "report_plan_name": "Description.ReportPlan.ReportPlanName", "report_setting": "Description.ReportPlan.ReportSetting", @@ -9463,6 +9584,7 @@ var getBackupReportPlanFilters = map[string]string{ "framework_name": "description.Framework.FrameworkName", "last_attempted_execution_time": "Description.ReportPlan.LastAttemptedExecutionTime", "last_successful_execution_time": "Description.ReportPlan.LastSuccessfulExecutionTime", + "og_account_id": "metadata.IntegrationID", "report_delivery_channel": "Description.ReportPlan.ReportDeliveryChannel", "report_plan_name": "Description.ReportPlan.ReportPlanName", "report_setting": "Description.ReportPlan.ReportSetting", @@ -9530,6 +9652,7 @@ type BackupRegionSetting struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BackupRegionSettingDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -9604,6 +9727,7 @@ func (p BackupRegionSettingPaginator) NextPage(ctx context.Context) ([]BackupReg } var listBackupRegionSettingFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "region": "Description.Region", "resource_type_management_preference": "Description.ResourceTypeManagementPreference", "resource_type_opt_in_preference": "Description.ResourceTypeOptInPreference", @@ -9671,6 +9795,7 @@ func ListBackupRegionSetting(ctx context.Context, d *plugin.QueryData, _ *plugin var getBackupRegionSettingFilters = map[string]string{ "framework_name": "description.Framework.FrameworkName", + "og_account_id": "metadata.IntegrationID", "region": "Description.Region", "resource_type_management_preference": "Description.ResourceTypeManagementPreference", "resource_type_opt_in_preference": "Description.ResourceTypeOptInPreference", @@ -9737,6 +9862,7 @@ type CloudFrontDistribution struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFrontDistributionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -9831,6 +9957,7 @@ var listCloudFrontDistributionFilters = map[string]string{ "is_ipv6_enabled": "Description.Distribution.DistributionConfig.IsIPV6Enabled", "last_modified_time": "Description.Distribution.LastModifiedTime", "logging": "Description.Distribution.DistributionConfig.Logging", + "og_account_id": "metadata.IntegrationID", "origin_groups": "Description.Distribution.DistributionConfig.OriginGroups", "origins": "Description.Distribution.DistributionConfig.Origins.Items", "price_class": "Description.Distribution.DistributionConfig.PriceClass", @@ -9923,6 +10050,7 @@ var getCloudFrontDistributionFilters = map[string]string{ "is_ipv6_enabled": "Description.Distribution.DistributionConfig.IsIPV6Enabled", "last_modified_time": "Description.Distribution.LastModifiedTime", "logging": "Description.Distribution.DistributionConfig.Logging", + "og_account_id": "metadata.IntegrationID", "origin_groups": "Description.Distribution.DistributionConfig.OriginGroups", "origins": "Description.Distribution.DistributionConfig.Origins.Items", "price_class": "Description.Distribution.DistributionConfig.PriceClass", @@ -9995,6 +10123,7 @@ type CloudFrontStreamingDistribution struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFrontStreamingDistributionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -10069,11 +10198,12 @@ func (p CloudFrontStreamingDistributionPaginator) NextPage(ctx context.Context) } var listCloudFrontStreamingDistributionFilters = map[string]string{ - "arn": "Description.StreamingDistribution.ARN", - "id": "Description.StreamingDistribution.Id", - "name": "Description.StreamingDistribution.Name", - "tags": "Description.StreamingDistribution.Tags", - "title": "Description.StreamingDistribution.Name", + "arn": "Description.StreamingDistribution.ARN", + "id": "Description.StreamingDistribution.Id", + "name": "Description.StreamingDistribution.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.StreamingDistribution.Tags", + "title": "Description.StreamingDistribution.Name", } func ListCloudFrontStreamingDistribution(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -10137,11 +10267,12 @@ func ListCloudFrontStreamingDistribution(ctx context.Context, d *plugin.QueryDat } var getCloudFrontStreamingDistributionFilters = map[string]string{ - "arn": "Description.StreamingDistribution.ARN", - "id": "Description.StreamingDistribution.Id", - "name": "Description.StreamingDistribution.Name", - "tags": "Description.StreamingDistribution.Tags", - "title": "Description.StreamingDistribution.Name", + "arn": "Description.StreamingDistribution.ARN", + "id": "Description.StreamingDistribution.Id", + "name": "Description.StreamingDistribution.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.StreamingDistribution.Tags", + "title": "Description.StreamingDistribution.Name", } func GetCloudFrontStreamingDistribution(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -10205,6 +10336,7 @@ type CloudFrontOriginAccessControl struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFrontOriginAccessControlDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -10279,10 +10411,11 @@ func (p CloudFrontOriginAccessControlPaginator) NextPage(ctx context.Context) ([ } var listCloudFrontOriginAccessControlFilters = map[string]string{ - "arn": "ARN", - "id": "Description.OriginAccessControl.Id", - "name": "Description.OriginAccessControl.Name", - "title": "Description.OriginAccessControl.Name", + "arn": "ARN", + "id": "Description.OriginAccessControl.Id", + "name": "Description.OriginAccessControl.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.OriginAccessControl.Name", } func ListCloudFrontOriginAccessControl(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -10346,10 +10479,11 @@ func ListCloudFrontOriginAccessControl(ctx context.Context, d *plugin.QueryData, } var getCloudFrontOriginAccessControlFilters = map[string]string{ - "arn": "ARN", - "id": "description.OriginAccessControl.Id", - "name": "Description.OriginAccessControl.Name", - "title": "Description.OriginAccessControl.Name", + "arn": "ARN", + "id": "description.OriginAccessControl.Id", + "name": "Description.OriginAccessControl.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.OriginAccessControl.Name", } func GetCloudFrontOriginAccessControl(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -10413,6 +10547,7 @@ type CloudFrontCachePolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFrontCachePolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -10495,6 +10630,7 @@ var listCloudFrontCachePolicyFilters = map[string]string{ "max_ttl": "Description.CachePolicy.CachePolicy.CachePolicyConfig.MaxTTL", "min_ttl": "Description.CachePolicy.CachePolicy.CachePolicyConfig.MinTTL", "name": "Description.CachePolicy.CachePolicy.CachePolicyConfig.Name", + "og_account_id": "metadata.IntegrationID", "parameters_in_cache_key_and_forwarded_to_origin": "Description.CachePolicy.CachePolicy.CachePolicyConfig.ParametersInCacheKeyAndForwardedToOrigin", "title": "Description.CachePolicy.CachePolicy.CachePolicyConfig.Name", } @@ -10568,6 +10704,7 @@ var getCloudFrontCachePolicyFilters = map[string]string{ "max_ttl": "Description.CachePolicy.CachePolicy.CachePolicyConfig.MaxTTL", "min_ttl": "Description.CachePolicy.CachePolicy.CachePolicyConfig.MinTTL", "name": "Description.CachePolicy.CachePolicy.CachePolicyConfig.Name", + "og_account_id": "metadata.IntegrationID", "parameters_in_cache_key_and_forwarded_to_origin": "Description.CachePolicy.CachePolicy.CachePolicyConfig.ParametersInCacheKeyAndForwardedToOrigin", "title": "Description.CachePolicy.CachePolicy.CachePolicyConfig.Name", } @@ -10633,6 +10770,7 @@ type CloudFrontFunction struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFrontFunctionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -10712,6 +10850,7 @@ var listCloudFrontFunctionFilters = map[string]string{ "function_config": "Description.Function.FunctionSummary.FunctionConfig", "function_metadata": "Description.Function.FunctionSummary.FunctionMetadata", "name": "Description.Function.FunctionSummary.Name", + "og_account_id": "metadata.IntegrationID", "status": "Description.Function.FunctionSummary.Status", "title": "Description.Function.FunctionSummary.Name", } @@ -10782,6 +10921,7 @@ var getCloudFrontFunctionFilters = map[string]string{ "function_config": "Description.Function.FunctionSummary.FunctionConfig", "function_metadata": "Description.Function.FunctionSummary.FunctionMetadata", "name": "description.Function.FunctionSummary.Name", + "og_account_id": "metadata.IntegrationID", "status": "Description.Function.FunctionSummary.Status", "title": "Description.Function.FunctionSummary.Name", } @@ -10847,6 +10987,7 @@ type CloudFrontOriginAccessIdentity struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFrontOriginAccessIdentityDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -10925,6 +11066,7 @@ var listCloudFrontOriginAccessIdentityFilters = map[string]string{ "comment": "Description.OriginAccessIdentity.CloudFrontOriginAccessIdentity.CloudFrontOriginAccessIdentityConfig.Comment", "etag": "Description.OriginAccessIdentity.ETag", "id": "Description.OriginAccessIdentity.CloudFrontOriginAccessIdentity.Id", + "og_account_id": "metadata.IntegrationID", "s3_canonical_user_id": "Description.OriginAccessIdentity.CloudFrontOriginAccessIdentity.S3CanonicalUserId", "title": "Description.OriginAccessIdentity.ResultMetadata", } @@ -10994,6 +11136,7 @@ var getCloudFrontOriginAccessIdentityFilters = map[string]string{ "comment": "Description.OriginAccessIdentity.CloudFrontOriginAccessIdentity.CloudFrontOriginAccessIdentityConfig.Comment", "etag": "Description.OriginAccessIdentity.ETag", "id": "description.OriginAccessIdentity.CloudFrontOriginAccessIdentity.Id", + "og_account_id": "metadata.IntegrationID", "s3_canonical_user_id": "Description.OriginAccessIdentity.CloudFrontOriginAccessIdentity.S3CanonicalUserId", "title": "Description.OriginAccessIdentity.ResultMetadata", } @@ -11059,6 +11202,7 @@ type CloudFrontOriginRequestPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFrontOriginRequestPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -11140,6 +11284,7 @@ var listCloudFrontOriginRequestPolicyFilters = map[string]string{ "id": "Description.OriginRequestPolicy.OriginRequestPolicy.Id", "last_modified_time": "Description.OriginRequestPolicy.OriginRequestPolicy.LastModifiedTime", "name": "Description.OriginRequestPolicy.OriginRequestPolicy.OriginRequestPolicyConfig.Name", + "og_account_id": "metadata.IntegrationID", "query_strings_config": "Description.OriginRequestPolicy.OriginRequestPolicy.OriginRequestPolicyConfig.QueryStringsConfig", "title": "Description.OriginRequestPolicy.OriginRequestPolicy.OriginRequestPolicyConfig.Name", } @@ -11212,6 +11357,7 @@ var getCloudFrontOriginRequestPolicyFilters = map[string]string{ "id": "description.OriginRequestPolicy.OriginRequestPolicy.Id", "last_modified_time": "Description.OriginRequestPolicy.OriginRequestPolicy.LastModifiedTime", "name": "Description.OriginRequestPolicy.OriginRequestPolicy.OriginRequestPolicyConfig.Name", + "og_account_id": "metadata.IntegrationID", "query_strings_config": "Description.OriginRequestPolicy.OriginRequestPolicy.OriginRequestPolicyConfig.QueryStringsConfig", "title": "Description.OriginRequestPolicy.OriginRequestPolicy.OriginRequestPolicyConfig.Name", } @@ -11277,6 +11423,7 @@ type CloudFrontResponseHeadersPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFrontResponseHeadersPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -11355,6 +11502,7 @@ var listCloudFrontResponseHeadersPolicyFilters = map[string]string{ "id": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.Id", "last_modified_time": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.LastModifiedTime", "name": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.Name", + "og_account_id": "metadata.IntegrationID", "response_headers_policy_config": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.ResponseHeadersPolicyConfig", "title": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.Name", "type": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.SecurityHeadersConfig.ContentTypeOptions", @@ -11425,6 +11573,7 @@ var getCloudFrontResponseHeadersPolicyFilters = map[string]string{ "id": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.Id", "last_modified_time": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.LastModifiedTime", "name": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.Name", + "og_account_id": "metadata.IntegrationID", "response_headers_policy_config": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.ResponseHeadersPolicyConfig", "title": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.Name", "type": "Description.ResponseHeadersPolicy.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.SecurityHeadersConfig.ContentTypeOptions", @@ -11491,6 +11640,7 @@ type CloudWatchAlarm struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudWatchAlarmDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -11581,6 +11731,7 @@ var listCloudWatchAlarmFilters = map[string]string{ "metrics": "Description.MetricAlarm.Metrics", "name": "description.MetricAlarm.AlarmName", "namespace": "Description.MetricAlarm.Namespace", + "og_account_id": "metadata.IntegrationID", "ok_actions": "Description.MetricAlarm.OKActions", "period": "Description.MetricAlarm.EvaluationPeriods", "state_reason": "Description.MetricAlarm.StateReason", @@ -11673,6 +11824,7 @@ var getCloudWatchAlarmFilters = map[string]string{ "metrics": "Description.MetricAlarm.Metrics", "name": "description.MetricAlarm.AlarmName", "namespace": "Description.MetricAlarm.Namespace", + "og_account_id": "metadata.IntegrationID", "ok_actions": "Description.MetricAlarm.OKActions", "period": "Description.MetricAlarm.EvaluationPeriods", "state_reason": "Description.MetricAlarm.StateReason", @@ -11749,6 +11901,7 @@ type CloudWatchLogEvent struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudWatchLogEventDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -11826,6 +11979,7 @@ var listCloudWatchLogEventFilters = map[string]string{ "event_id": "Description.LogEvent.EventId", "log_group_name": "description.LogGroupName", "log_stream_name": "description.LogEvent.LogStreamName", + "og_account_id": "metadata.IntegrationID", "timestamp": "description.LogEvent.Timestamp", } @@ -11893,6 +12047,7 @@ var getCloudWatchLogEventFilters = map[string]string{ "event_id": "Description.LogEvent.EventId", "log_group_name": "Description.LogGroupName", "log_stream_name": "Description.LogEvent.LogStreamName", + "og_account_id": "metadata.IntegrationID", } func GetCloudWatchLogEvent(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -11956,6 +12111,7 @@ type CloudWatchLogResourcePolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudWatchLogResourcePolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -12030,9 +12186,10 @@ func (p CloudWatchLogResourcePolicyPaginator) NextPage(ctx context.Context) ([]C } var listCloudWatchLogResourcePolicyFilters = map[string]string{ - "policy": "Description.ResourcePolicy.PolicyDocument", - "policy_name": "Description.ResourcePolicy.PolicyName", - "title": "Description.ResourcePolicy.PolicyName", + "og_account_id": "metadata.IntegrationID", + "policy": "Description.ResourcePolicy.PolicyDocument", + "policy_name": "Description.ResourcePolicy.PolicyName", + "title": "Description.ResourcePolicy.PolicyName", } func ListCloudWatchLogResourcePolicy(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -12096,9 +12253,10 @@ func ListCloudWatchLogResourcePolicy(ctx context.Context, d *plugin.QueryData, _ } var getCloudWatchLogResourcePolicyFilters = map[string]string{ - "policy": "Description.ResourcePolicy.PolicyDocument", - "policy_name": "Description.ResourcePolicy.PolicyName", - "title": "Description.ResourcePolicy.PolicyName", + "og_account_id": "metadata.IntegrationID", + "policy": "Description.ResourcePolicy.PolicyDocument", + "policy_name": "Description.ResourcePolicy.PolicyName", + "title": "Description.ResourcePolicy.PolicyName", } func GetCloudWatchLogResourcePolicy(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -12162,6 +12320,7 @@ type CloudWatchLogStream struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudWatchLogStreamDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -12239,6 +12398,7 @@ var listCloudWatchLogStreamFilters = map[string]string{ "arn": "Description.LogStream.Arn", "log_group_name": "Description.LogGroupName", "name": "description.LogStream.LogStreamName", + "og_account_id": "metadata.IntegrationID", "title": "Description.LogStream.LogStreamName", "upload_sequence_token": "Description.LogStream.UploadSequenceToken", } @@ -12307,6 +12467,7 @@ var getCloudWatchLogStreamFilters = map[string]string{ "arn": "Description.LogStream.Arn", "log_group_name": "Description.LogGroupName", "name": "description.LogStream.LogStreamName", + "og_account_id": "metadata.IntegrationID", "title": "Description.LogStream.LogStreamName", "upload_sequence_token": "Description.LogStream.UploadSequenceToken", } @@ -12372,6 +12533,7 @@ type CloudWatchLogSubscriptionFilter struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudWatchLogSubscriptionFilterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -12451,6 +12613,7 @@ var listCloudWatchLogSubscriptionFilterFilters = map[string]string{ "filter_pattern": "Description.SubscriptionFilter.FilterPattern", "log_group_name": "description.SubscriptionFilter.LogGroupName", "name": "description.SubscriptionFilter.FilterName", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.SubscriptionFilter.RoleArn", "title": "Description.SubscriptionFilter.FilterName", } @@ -12521,6 +12684,7 @@ var getCloudWatchLogSubscriptionFilterFilters = map[string]string{ "filter_pattern": "Description.SubscriptionFilter.FilterPattern", "log_group_name": "description.SubscriptionFilter.LogGroupName", "name": "description.SubscriptionFilter.FilterName", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.SubscriptionFilter.RoleArn", "title": "Description.SubscriptionFilter.FilterName", } @@ -12586,6 +12750,7 @@ type CloudWatchMetric struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudWatchMetricDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -12660,10 +12825,11 @@ func (p CloudWatchMetricPaginator) NextPage(ctx context.Context) ([]CloudWatchMe } var listCloudWatchMetricFilters = map[string]string{ - "dimensions": "Description.Metric.Dimensions", - "metric_name": "description.Metric.MetricName", - "namespace": "description.Metric.Namespace", - "title": "Description.Metric.MetricName", + "dimensions": "Description.Metric.Dimensions", + "metric_name": "description.Metric.MetricName", + "namespace": "description.Metric.Namespace", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Metric.MetricName", } func ListCloudWatchMetric(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -12727,10 +12893,11 @@ func ListCloudWatchMetric(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy } var getCloudWatchMetricFilters = map[string]string{ - "dimensions": "Description.Metric.Dimensions", - "metric_name": "Description.Metric.MetricName", - "namespace": "Description.Metric.Namespace", - "title": "Description.Metric.MetricName", + "dimensions": "Description.Metric.Dimensions", + "metric_name": "Description.Metric.MetricName", + "namespace": "Description.Metric.Namespace", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Metric.MetricName", } func GetCloudWatchMetric(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -12794,6 +12961,7 @@ type CloudWatchLogsLogGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudWatchLogsLogGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -12874,6 +13042,7 @@ var listCloudWatchLogsLogGroupFilters = map[string]string{ "kms_key_id": "Description.LogGroup.KmsKeyId", "metric_filter_count": "Description.LogGroup.MetricFilterCount", "name": "description.LogGroup.LogGroupName", + "og_account_id": "metadata.IntegrationID", "retention_in_days": "Description.LogGroup.RetentionInDays", "stored_bytes": "Description.LogGroup.StoredBytes", "tags": "Description.Tags", @@ -12947,6 +13116,7 @@ var getCloudWatchLogsLogGroupFilters = map[string]string{ "kms_key_id": "Description.LogGroup.KmsKeyId", "metric_filter_count": "Description.LogGroup.MetricFilterCount", "name": "description.LogGroup.LogGroupName", + "og_account_id": "metadata.IntegrationID", "retention_in_days": "Description.LogGroup.RetentionInDays", "stored_bytes": "Description.LogGroup.StoredBytes", "tags": "Description.Tags", @@ -13014,6 +13184,7 @@ type CloudWatchLogsMetricFilter struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudWatchLogsMetricFilterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -13093,6 +13264,7 @@ var listCloudWatchLogsMetricFilterFilters = map[string]string{ "metric_transformation_name": "decsription.MetricFilter.MetricTransformations.MetricName", "metric_transformation_namespace": "decsription.MetricFilter.MetricTransformations.MetricNamespace", "name": "decsription.MetricFilter.FilterName", + "og_account_id": "metadata.IntegrationID", "title": "Description.MetricFilter.FilterName", } @@ -13160,6 +13332,7 @@ var getCloudWatchLogsMetricFilterFilters = map[string]string{ "filter_pattern": "Description.MetricFilter.FilterPattern", "log_group_name": "Description.MetricFilter.LogGroupName", "name": "decsription.MetricFilter.FilterName", + "og_account_id": "metadata.IntegrationID", "title": "Description.MetricFilter.FilterName", } @@ -13224,6 +13397,7 @@ type CodeBuildProject struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeBuildProjectDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -13312,6 +13486,7 @@ var listCodeBuildProjectFilters = map[string]string{ "last_modified": "Description.Project.LastModified", "logs_config": "Description.Project.LogsConfig", "name": "Description.Project.Name", + "og_account_id": "metadata.IntegrationID", "project_visibility": "Description.Project.ProjectVisibility", "queued_timeout_in_minutes": "Description.Project.QueuedTimeoutInMinutes", "secondary_artifacts": "Description.Project.SecondaryArtifacts", @@ -13402,6 +13577,7 @@ var getCodeBuildProjectFilters = map[string]string{ "last_modified": "Description.Project.LastModified", "logs_config": "Description.Project.LogsConfig", "name": "description.Project.Name", + "og_account_id": "metadata.IntegrationID", "project_visibility": "Description.Project.ProjectVisibility", "queued_timeout_in_minutes": "Description.Project.QueuedTimeoutInMinutes", "secondary_artifacts": "Description.Project.SecondaryArtifacts", @@ -13478,6 +13654,7 @@ type CodeBuildSourceCredential struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeBuildSourceCredentialDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -13552,9 +13729,10 @@ func (p CodeBuildSourceCredentialPaginator) NextPage(ctx context.Context) ([]Cod } var listCodeBuildSourceCredentialFilters = map[string]string{ - "arn": "Description.SourceCredentialsInfo.Arn", - "auth_type": "Description.SourceCredentialsInfo.AuthType", - "server_type": "Description.SourceCredentialsInfo.ServerType", + "arn": "Description.SourceCredentialsInfo.Arn", + "auth_type": "Description.SourceCredentialsInfo.AuthType", + "og_account_id": "metadata.IntegrationID", + "server_type": "Description.SourceCredentialsInfo.ServerType", } func ListCodeBuildSourceCredential(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -13618,9 +13796,10 @@ func ListCodeBuildSourceCredential(ctx context.Context, d *plugin.QueryData, _ * } var getCodeBuildSourceCredentialFilters = map[string]string{ - "arn": "Description.SourceCredentialsInfo.Arn", - "auth_type": "Description.SourceCredentialsInfo.AuthType", - "server_type": "Description.SourceCredentialsInfo.ServerType", + "arn": "Description.SourceCredentialsInfo.Arn", + "auth_type": "Description.SourceCredentialsInfo.AuthType", + "og_account_id": "metadata.IntegrationID", + "server_type": "Description.SourceCredentialsInfo.ServerType", } func GetCodeBuildSourceCredential(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -13684,6 +13863,7 @@ type CodeBuildBuild struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeBuildBuildDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -13776,6 +13956,7 @@ var listCodeBuildBuildFilters = map[string]string{ "initiator": "Description.Build.Initiator", "logs": "Description.Build.Logs", "network_interfaces": "Description.Build.NetworkInterface", + "og_account_id": "metadata.IntegrationID", "phases": "Description.Build.Phases", "project_name": "Description.Build.ProjectName", "queued_timeout_in_minutes": "Description.Build.QueuedTimeoutInMinutes", @@ -13871,6 +14052,7 @@ var getCodeBuildBuildFilters = map[string]string{ "initiator": "Description.Build.Initiator", "logs": "Description.Build.Logs", "network_interfaces": "Description.Build.NetworkInterface", + "og_account_id": "metadata.IntegrationID", "phases": "Description.Build.Phases", "project_name": "Description.Build.ProjectName", "queued_timeout_in_minutes": "Description.Build.QueuedTimeoutInMinutes", @@ -13948,6 +14130,7 @@ type ConfigConfigurationRecorder struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ConfigConfigurationRecorderDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -14024,6 +14207,7 @@ func (p ConfigConfigurationRecorderPaginator) NextPage(ctx context.Context) ([]C var listConfigConfigurationRecorderFilters = map[string]string{ "arn": "ARN", "name": "description.ConfigurationRecorder.Name", + "og_account_id": "metadata.IntegrationID", "recording_group": "Description.ConfigurationRecorder.RecordingGroup", "role_arn": "Description.ConfigurationRecorder.RoleARN", "status": "Description.ConfigurationRecordersStatus", @@ -14094,6 +14278,7 @@ func ListConfigConfigurationRecorder(ctx context.Context, d *plugin.QueryData, _ var getConfigConfigurationRecorderFilters = map[string]string{ "arn": "ARN", "name": "description.ConfigurationRecorder.Name", + "og_account_id": "metadata.IntegrationID", "recording_group": "Description.ConfigurationRecorder.RecordingGroup", "role_arn": "Description.ConfigurationRecorder.RoleARN", "status": "Description.ConfigurationRecordersStatus", @@ -14162,6 +14347,7 @@ type ConfigAggregationAuthorization struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ConfigAggregationAuthorizationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -14240,6 +14426,7 @@ var listConfigAggregationAuthorizationFilters = map[string]string{ "authorized_account_id": "Description.AggregationAuthorization.AuthorizedAccountId", "authorized_aws_region": "Description.AggregationAuthorization.AuthorizedAwsRegion", "creation_time": "Description.AggregationAuthorization.CreationTime", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.Tags", "title": "Description.AggregationAuthorization.AggregationAuthorizationArn", } @@ -14309,6 +14496,7 @@ var getConfigAggregationAuthorizationFilters = map[string]string{ "authorized_account_id": "Description.AggregationAuthorization.AuthorizedAccountId", "authorized_aws_region": "Description.AggregationAuthorization.AuthorizedAwsRegion", "creation_time": "Description.AggregationAuthorization.CreationTime", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.Tags", "title": "Description.AggregationAuthorization.AggregationAuthorizationArn", } @@ -14374,6 +14562,7 @@ type ConfigConformancePack struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ConfigConformancePackDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -14456,6 +14645,7 @@ var listConfigConformancePackFilters = map[string]string{ "input_parameters": "Description.ConformancePack.ConformancePackInputParameters", "last_update_requested_time": "Description.ConformancePack.LastUpdateRequestedTime", "name": "Description.ConformancePack.ConformancePackName", + "og_account_id": "metadata.IntegrationID", "title": "Description.ConformancePack.ConformancePackName", } @@ -14528,6 +14718,7 @@ var getConfigConformancePackFilters = map[string]string{ "input_parameters": "Description.ConformancePack.ConformancePackInputParameters", "last_update_requested_time": "Description.ConformancePack.LastUpdateRequestedTime", "name": "description.ConformancePack.ConformancePackName", + "og_account_id": "metadata.IntegrationID", "title": "Description.ConformancePack.ConformancePackName", } @@ -14592,6 +14783,7 @@ type ConfigRule struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ConfigRuleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -14674,6 +14866,7 @@ var listConfigRuleFilters = map[string]string{ "input_parameters": "Description.Rule.InputParameters", "maximum_execution_frequency": "Description.Rule.MaximumExecutionFrequency", "name": "Description.Rule.ConfigRuleName", + "og_account_id": "metadata.IntegrationID", "rule_id": "Description.Rule.ConfigRuleId", "rule_state": "Description.Rule.ConfigRuleState", "scope": "Description.Rule.Scope", @@ -14751,6 +14944,7 @@ var getConfigRuleFilters = map[string]string{ "input_parameters": "Description.Rule.InputParameters", "maximum_execution_frequency": "Description.Rule.MaximumExecutionFrequency", "name": "description.Rule.ConfigRuleName", + "og_account_id": "metadata.IntegrationID", "rule_id": "Description.Rule.ConfigRuleId", "rule_state": "Description.Rule.ConfigRuleState", "scope": "Description.Rule.Scope", @@ -14820,6 +15014,7 @@ type ConfigRetentionConfiguration struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ConfigRetentionConfigurationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -14895,6 +15090,7 @@ func (p ConfigRetentionConfigurationPaginator) NextPage(ctx context.Context) ([] var listConfigRetentionConfigurationFilters = map[string]string{ "name": "Description.RetentionConfiguration.Name", + "og_account_id": "metadata.IntegrationID", "retention_period_in_days": "Description.RetentionConfiguration.RetentionPeriodInDays", "title": "Description.RetentionConfiguration.Name", } @@ -14961,6 +15157,7 @@ func ListConfigRetentionConfiguration(ctx context.Context, d *plugin.QueryData, var getConfigRetentionConfigurationFilters = map[string]string{ "name": "description.ConformancePack.ConformancePackName", + "og_account_id": "metadata.IntegrationID", "retention_period_in_days": "Description.RetentionConfiguration.RetentionPeriodInDays", "title": "Description.RetentionConfiguration.Name", } @@ -15026,6 +15223,7 @@ type DAXCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DAXClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -15110,6 +15308,7 @@ var listDAXClusterFilters = map[string]string{ "node_type": "Description.Cluster.NodeType", "nodes": "Description.Cluster.Nodes", "notification_configuration": "Description.Cluster.NotificationConfiguration", + "og_account_id": "metadata.IntegrationID", "parameter_group": "Description.Cluster.ParameterGroup", "preferred_maintenance_window": "Description.Cluster.PreferredMaintenanceWindow", "security_groups": "Description.Cluster.SecurityGroups", @@ -15192,6 +15391,7 @@ var getDAXClusterFilters = map[string]string{ "node_type": "Description.Cluster.NodeType", "nodes": "Description.Cluster.Nodes", "notification_configuration": "Description.Cluster.NotificationConfiguration", + "og_account_id": "metadata.IntegrationID", "parameter_group": "Description.Cluster.ParameterGroup", "preferred_maintenance_window": "Description.Cluster.PreferredMaintenanceWindow", "security_groups": "Description.Cluster.SecurityGroups", @@ -15264,6 +15464,7 @@ type DAXParameterGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DAXParameterGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -15339,6 +15540,7 @@ func (p DAXParameterGroupPaginator) NextPage(ctx context.Context) ([]DAXParamete var listDAXParameterGroupFilters = map[string]string{ "description": "Description.ParameterGroup.Description", + "og_account_id": "metadata.IntegrationID", "parameter_group_name": "description.ParameterGroup.ParameterGroupName", "title": "Description.ParameterGroup.ParameterGroupName", } @@ -15405,6 +15607,7 @@ func ListDAXParameterGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.H var getDAXParameterGroupFilters = map[string]string{ "description": "Description.ParameterGroup.Description", + "og_account_id": "metadata.IntegrationID", "parameter_group_name": "Description.ParameterGroup.ParameterGroupName", "title": "Description.ParameterGroup.ParameterGroupName", } @@ -15470,6 +15673,7 @@ type DAXParameter struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DAXParameterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -15549,6 +15753,7 @@ var listDAXParameterFilters = map[string]string{ "data_type": "Description.Parameter.DataType", "description": "Description.Parameter.Description", "is_modifiable": "Description.Parameter.IsModifiable", + "og_account_id": "metadata.IntegrationID", "parameter_group_name": "description.ParameterGroupName", "parameter_name": "Description.Parameter.ParameterName", "parameter_type": "Description.Parameter.ParameterType", @@ -15623,6 +15828,7 @@ var getDAXParameterFilters = map[string]string{ "data_type": "Description.Parameter.DataType", "description": "Description.Parameter.Description", "is_modifiable": "Description.Parameter.IsModifiable", + "og_account_id": "metadata.IntegrationID", "parameter_group_name": "Description.ParameterGroupName", "parameter_name": "Description.Parameter.ParameterName", "parameter_type": "Description.Parameter.ParameterType", @@ -15692,6 +15898,7 @@ type DAXSubnetGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DAXSubnetGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -15767,6 +15974,7 @@ func (p DAXSubnetGroupPaginator) NextPage(ctx context.Context) ([]DAXSubnetGroup var listDAXSubnetGroupFilters = map[string]string{ "description": "Description.SubnetGroup.Description", + "og_account_id": "metadata.IntegrationID", "subnet_group_name": "description.SubnetGroup.SubnetGroupName", "subnets": "Description.SubnetGroup.Subnets", "title": "Description.SubnetGroup.SubnetGroupName", @@ -15835,6 +16043,7 @@ func ListDAXSubnetGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr var getDAXSubnetGroupFilters = map[string]string{ "description": "Description.SubnetGroup.Description", + "og_account_id": "metadata.IntegrationID", "subnet_group_name": "Description.SubnetGroup.SubnetGroupName", "subnets": "Description.SubnetGroup.Subnets", "title": "Description.SubnetGroup.SubnetGroupName", @@ -15902,6 +16111,7 @@ type DMSReplicationInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DMSReplicationInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -15986,6 +16196,7 @@ var listDMSReplicationInstanceFilters = map[string]string{ "instance_create_time": "Description.ReplicationInstance.InstanceCreateTime", "kms_key_id": "Description.ReplicationInstance.KmsKeyId", "multi_az": "Description.ReplicationInstance.MultiAZ", + "og_account_id": "metadata.IntegrationID", "pending_modified_values": "Description.ReplicationInstance.PendingModifiedValues", "preferred_maintenance_window": "Description.ReplicationInstance.PreferredMaintenanceWindow", "publicly_accessible": "Description.ReplicationInstance.PubliclyAccessible", @@ -16074,6 +16285,7 @@ var getDMSReplicationInstanceFilters = map[string]string{ "instance_create_time": "Description.ReplicationInstance.InstanceCreateTime", "kms_key_id": "Description.ReplicationInstance.KmsKeyId", "multi_az": "Description.ReplicationInstance.MultiAZ", + "og_account_id": "metadata.IntegrationID", "pending_modified_values": "Description.ReplicationInstance.PendingModifiedValues", "preferred_maintenance_window": "Description.ReplicationInstance.PreferredMaintenanceWindow", "publicly_accessible": "Description.ReplicationInstance.PubliclyAccessible", @@ -16152,6 +16364,7 @@ type DMSEndpoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DMSEndpointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -16426,6 +16639,7 @@ type DMSReplicationTask struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DMSReplicationTaskDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -16668,6 +16882,7 @@ type DynamoDbTable struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DynamoDbTableDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -16754,6 +16969,7 @@ var listDynamoDbTableFilters = map[string]string{ "latest_stream_arn": "Description.Table.LatestStreamArn", "latest_stream_label": "Description.Table.LatestStreamLabel", "name": "description.Table.TableName", + "og_account_id": "metadata.IntegrationID", "point_in_time_recovery_description": "Description.ContinuousBackup.PointInTimeRecoveryDescription", "read_capacity": "Description.Table.ProvisionedThroughput.ReadCapacityUnits", "sse_description": "Description.Table.SSEDescription", @@ -16840,6 +17056,7 @@ var getDynamoDbTableFilters = map[string]string{ "latest_stream_arn": "Description.Table.LatestStreamArn", "latest_stream_label": "Description.Table.LatestStreamLabel", "name": "description.Table.TableName", + "og_account_id": "metadata.IntegrationID", "point_in_time_recovery_description": "Description.ContinuousBackup.PointInTimeRecoveryDescription", "read_capacity": "Description.Table.ProvisionedThroughput.ReadCapacityUnits", "sse_description": "Description.Table.SSEDescription", @@ -16914,6 +17131,7 @@ type DynamoDbGlobalSecondaryIndex struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DynamoDbGlobalSecondaryIndexDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -16988,9 +17206,10 @@ func (p DynamoDbGlobalSecondaryIndexPaginator) NextPage(ctx context.Context) ([] } var listDynamoDbGlobalSecondaryIndexFilters = map[string]string{ - "index_arn": "Description.GlobalSecondaryIndex.IndexArn", - "index_name": "Description.GlobalSecondaryIndex.IndexName", - "title": "Description.GlobalSecondaryIndex.IndexName", + "index_arn": "Description.GlobalSecondaryIndex.IndexArn", + "index_name": "Description.GlobalSecondaryIndex.IndexName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.GlobalSecondaryIndex.IndexName", } func ListDynamoDbGlobalSecondaryIndex(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -17054,9 +17273,10 @@ func ListDynamoDbGlobalSecondaryIndex(ctx context.Context, d *plugin.QueryData, } var getDynamoDbGlobalSecondaryIndexFilters = map[string]string{ - "index_arn": "description.GlobalSecondaryIndex.IndexArn", - "index_name": "Description.GlobalSecondaryIndex.IndexName", - "title": "Description.GlobalSecondaryIndex.IndexName", + "index_arn": "description.GlobalSecondaryIndex.IndexArn", + "index_name": "Description.GlobalSecondaryIndex.IndexName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.GlobalSecondaryIndex.IndexName", } func GetDynamoDbGlobalSecondaryIndex(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -17120,6 +17340,7 @@ type DynamoDbLocalSecondaryIndex struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DynamoDbLocalSecondaryIndexDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -17194,9 +17415,10 @@ func (p DynamoDbLocalSecondaryIndexPaginator) NextPage(ctx context.Context) ([]D } var listDynamoDbLocalSecondaryIndexFilters = map[string]string{ - "index_arn": "Description.LocalSecondaryIndex.IndexArn", - "index_name": "Description.LocalSecondaryIndex.IndexName", - "title": "Description.LocalSecondaryIndex.IndexName", + "index_arn": "Description.LocalSecondaryIndex.IndexArn", + "index_name": "Description.LocalSecondaryIndex.IndexName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.LocalSecondaryIndex.IndexName", } func ListDynamoDbLocalSecondaryIndex(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -17260,9 +17482,10 @@ func ListDynamoDbLocalSecondaryIndex(ctx context.Context, d *plugin.QueryData, _ } var getDynamoDbLocalSecondaryIndexFilters = map[string]string{ - "index_arn": "description.LocalSecondaryIndex.IndexArn", - "index_name": "Description.LocalSecondaryIndex.IndexName", - "title": "Description.LocalSecondaryIndex.IndexName", + "index_arn": "description.LocalSecondaryIndex.IndexArn", + "index_name": "Description.LocalSecondaryIndex.IndexName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.LocalSecondaryIndex.IndexName", } func GetDynamoDbLocalSecondaryIndex(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -17326,6 +17549,7 @@ type DynamoDbStream struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DynamoDbStreamDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -17400,9 +17624,10 @@ func (p DynamoDbStreamPaginator) NextPage(ctx context.Context) ([]DynamoDbStream } var listDynamoDbStreamFilters = map[string]string{ - "stream_arn": "Description.Stream.StreamArn", - "stream_label": "Description.Stream.StreamLabel", - "title": "Description.Stream.StreamLabel", + "og_account_id": "metadata.IntegrationID", + "stream_arn": "Description.Stream.StreamArn", + "stream_label": "Description.Stream.StreamLabel", + "title": "Description.Stream.StreamLabel", } func ListDynamoDbStream(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -17466,9 +17691,10 @@ func ListDynamoDbStream(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr } var getDynamoDbStreamFilters = map[string]string{ - "stream_arn": "description.Stream.StreamArn", - "stream_label": "Description.Stream.StreamLabel", - "title": "Description.Stream.StreamLabel", + "og_account_id": "metadata.IntegrationID", + "stream_arn": "description.Stream.StreamArn", + "stream_label": "Description.Stream.StreamLabel", + "title": "Description.Stream.StreamLabel", } func GetDynamoDbStream(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -17532,6 +17758,7 @@ type DynamoDbBackup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DynamoDbBackupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -17613,6 +17840,7 @@ var listDynamoDbBackupFilters = map[string]string{ "backup_status": "Description.Backup.BackupStatus", "backup_type": "description.Backup.BackupType", "name": "Description.Backup.BackupName", + "og_account_id": "metadata.IntegrationID", "table_arn": "Description.Backup.TableArn", "table_id": "Description.Backup.TableId", "table_name": "description.Backup.TableName", @@ -17687,6 +17915,7 @@ var getDynamoDbBackupFilters = map[string]string{ "backup_status": "Description.Backup.BackupStatus", "backup_type": "Description.Backup.BackupType", "name": "Description.Backup.BackupName", + "og_account_id": "metadata.IntegrationID", "table_arn": "Description.Backup.TableArn", "table_id": "Description.Backup.TableId", "table_name": "Description.Backup.TableName", @@ -17754,6 +17983,7 @@ type DynamoDbGlobalTable struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DynamoDbGlobalTableDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -17832,6 +18062,7 @@ var listDynamoDbGlobalTableFilters = map[string]string{ "global_table_arn": "Description.GlobalTable.GlobalTableArn", "global_table_name": "description.GlobalTable.GlobalTableName", "global_table_status": "Description.GlobalTable.GlobalTableStatus", + "og_account_id": "metadata.IntegrationID", "replication_group": "Description.GlobalTable.ReplicationGroup", "title": "Description.GlobalTable.GlobalTableName", } @@ -17901,6 +18132,7 @@ var getDynamoDbGlobalTableFilters = map[string]string{ "global_table_arn": "Description.GlobalTable.GlobalTableArn", "global_table_name": "description.GlobalTable.GlobalTableName", "global_table_status": "Description.GlobalTable.GlobalTableStatus", + "og_account_id": "metadata.IntegrationID", "replication_group": "Description.GlobalTable.ReplicationGroup", "title": "Description.GlobalTable.GlobalTableName", } @@ -17966,6 +18198,7 @@ type DynamoDbTableExport struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DynamoDbTableExportDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -18051,6 +18284,7 @@ var listDynamoDbTableExportFilters = map[string]string{ "failure_code": "Description.Export.FailureCode", "failure_message": "Description.Export.FailureMessage", "item_count": "Description.Export.ItemCount", + "og_account_id": "metadata.IntegrationID", "s3_bucket": "Description.Export.S3Bucket", "s3_bucket_owner": "Description.Export.S3BucketOwner", "s3_prefix": "Description.Export.S3Prefix", @@ -18133,6 +18367,7 @@ var getDynamoDbTableExportFilters = map[string]string{ "failure_code": "Description.Export.FailureCode", "failure_message": "Description.Export.FailureMessage", "item_count": "Description.Export.ItemCount", + "og_account_id": "metadata.IntegrationID", "s3_bucket": "Description.Export.S3Bucket", "s3_bucket_owner": "Description.Export.S3BucketOwner", "s3_prefix": "Description.Export.S3Prefix", @@ -18204,6 +18439,7 @@ type OAMLink struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OAMLinkDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -18282,6 +18518,7 @@ var listOAMLinkFilters = map[string]string{ "id": "Description.Link.Id", "label": "Description.Link.Label", "label_template": "Description.Link.LabelTemplate", + "og_account_id": "metadata.IntegrationID", "resource_types": "Description.Link.ResourceTypes", "sink_arn": "Description.Link.SinkArn", "tags": "Description.Link.Tags", @@ -18353,6 +18590,7 @@ var getOAMLinkFilters = map[string]string{ "id": "Description.Link.Id", "label": "Description.Link.Label", "label_template": "Description.Link.LabelTemplate", + "og_account_id": "metadata.IntegrationID", "resource_types": "Description.Link.ResourceTypes", "sink_arn": "Description.Link.SinkArn", "tags": "Description.Link.Tags", @@ -18420,6 +18658,7 @@ type OAMSink struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OAMSinkDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -18494,11 +18733,12 @@ func (p OAMSinkPaginator) NextPage(ctx context.Context) ([]OAMSink, error) { } var listOAMSinkFilters = map[string]string{ - "arn": "Description.Sink.Arn", - "id": "Description.Sink.Id", - "name": "Description.Sink.Name", - "tags": "Description.Tags", - "title": "Description.Sink.Name", + "arn": "Description.Sink.Arn", + "id": "Description.Sink.Id", + "name": "Description.Sink.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Sink.Name", } func ListOAMSink(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -18562,11 +18802,12 @@ func ListOAMSink(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData } var getOAMSinkFilters = map[string]string{ - "arn": "description.Sink.Arn", - "id": "Description.Sink.Id", - "name": "Description.Sink.Name", - "tags": "Description.Tags", - "title": "Description.Sink.Name", + "arn": "description.Sink.Arn", + "id": "Description.Sink.Id", + "name": "Description.Sink.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Sink.Name", } func GetOAMSink(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -18630,6 +18871,7 @@ type EC2VolumeSnapshot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VolumeSnapshotDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -18710,6 +18952,7 @@ var listEC2VolumeSnapshotFilters = map[string]string{ "description": "description.Snapshot.Description", "encrypted": "description.Snapshot.Encrypted", "kms_key_id": "Description.Snapshot.KmsKeyId", + "og_account_id": "metadata.IntegrationID", "owner_alias": "description.Snapshot.OwnerAlias", "owner_id": "description.Snapshot.OwnerId", "progress": "description.Snapshot.Progress", @@ -18790,6 +19033,7 @@ var getEC2VolumeSnapshotFilters = map[string]string{ "description": "Description.Snapshot.Description", "encrypted": "Description.Snapshot.Encrypted", "kms_key_id": "Description.Snapshot.KmsKeyId", + "og_account_id": "metadata.IntegrationID", "owner_alias": "Description.Snapshot.OwnerAlias", "owner_id": "Description.Snapshot.OwnerId", "progress": "Description.Snapshot.Progress", @@ -18864,6 +19108,7 @@ type EC2ElasticIP struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2ElasticIPDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -18938,8 +19183,9 @@ func (p EC2ElasticIPPaginator) NextPage(ctx context.Context) ([]EC2ElasticIP, er } var listEC2ElasticIPFilters = map[string]string{ - "id": "Description.Address.AllocationId", - "title": "Description.Address.AllocationId", + "id": "Description.Address.AllocationId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Address.AllocationId", } func ListEC2ElasticIP(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -19003,8 +19249,9 @@ func ListEC2ElasticIP(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydrat } var getEC2ElasticIPFilters = map[string]string{ - "id": "Description.Address.AllocationId", - "title": "Description.Address.AllocationId", + "id": "Description.Address.AllocationId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Address.AllocationId", } func GetEC2ElasticIP(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -19068,6 +19315,7 @@ type EC2CustomerGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2CustomerGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -19148,6 +19396,7 @@ var listEC2CustomerGatewayFilters = map[string]string{ "customer_gateway_id": "Description.CustomerGateway.CustomerGatewayId", "device_name": "Description.CustomerGateway.DeviceName", "ip_address": "description.CustomerGateway.IpAddress", + "og_account_id": "metadata.IntegrationID", "state": "description.CustomerGateway.State", "tags_src": "Description.CustomerGateway.Tags", "type": "description.CustomerGateway.Type", @@ -19220,6 +19469,7 @@ var getEC2CustomerGatewayFilters = map[string]string{ "customer_gateway_id": "description.CustomerGateway.CustomerGatewayId", "device_name": "Description.CustomerGateway.DeviceName", "ip_address": "Description.CustomerGateway.IpAddress", + "og_account_id": "metadata.IntegrationID", "state": "Description.CustomerGateway.State", "tags_src": "Description.CustomerGateway.Tags", "type": "Description.CustomerGateway.Type", @@ -19286,6 +19536,7 @@ type EC2VerifiedAccessInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VerifiedAccessInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -19363,6 +19614,7 @@ var listEC2VerifiedAccessInstanceFilters = map[string]string{ "creation_time": "Description.VerifiedAccountInstance.CreationTime", "description": "Description.VerifiedAccountInstance.Description", "last_updated_time": "Description.VerifiedAccountInstance.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.VerifiedAccountInstance.Tags", "verified_access_instance_id": "description.VerifiedAccountInstance.VerifiedAccessInstanceId", "verified_access_trust_providers": "Description.VerifiedAccountInstance.VerifiedAccessTrustProviders", @@ -19432,6 +19684,7 @@ var getEC2VerifiedAccessInstanceFilters = map[string]string{ "creation_time": "Description.VerifiedAccountInstance.CreationTime", "description": "Description.VerifiedAccountInstance.Description", "last_updated_time": "Description.VerifiedAccountInstance.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.VerifiedAccountInstance.Tags", "verified_access_instance_id": "Description.VerifiedAccountInstance.VerifiedAccessInstanceId", "verified_access_trust_providers": "Description.VerifiedAccountInstance.VerifiedAccessTrustProviders", @@ -19498,6 +19751,7 @@ type EC2VerifiedAccessEndpoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VerifiedAccessEndpointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -19584,6 +19838,7 @@ var listEC2VerifiedAccessEndpointFilters = map[string]string{ "last_updated_time": "Description.VerifiedAccountEndpoint.LastUpdatedTime", "load_balancer_options": "Description.VerifiedAccountEndpoint.LoadBalancerOptions", "network_interface_options": "Description.VerifiedAccountEndpoint.NetworkInterfaceOptions", + "og_account_id": "metadata.IntegrationID", "status": "Description.VerifiedAccountEndpoint.Status", "status_code": "Description.VerifiedAccountEndpoint.Status.Code", "tags_src": "Description.VerifiedAccountEndpoint.Tags", @@ -19665,6 +19920,7 @@ var getEC2VerifiedAccessEndpointFilters = map[string]string{ "last_updated_time": "Description.VerifiedAccountEndpoint.LastUpdatedTime", "load_balancer_options": "Description.VerifiedAccountEndpoint.LoadBalancerOptions", "network_interface_options": "Description.VerifiedAccountEndpoint.NetworkInterfaceOptions", + "og_account_id": "metadata.IntegrationID", "status": "Description.VerifiedAccountEndpoint.Status", "status_code": "Description.VerifiedAccountEndpoint.Status.Code", "tags_src": "Description.VerifiedAccountEndpoint.Tags", @@ -19734,6 +19990,7 @@ type EC2VerifiedAccessGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VerifiedAccessGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -19813,6 +20070,7 @@ var listEC2VerifiedAccessGroupFilters = map[string]string{ "deletion_time": "Description.VerifiedAccountGroup.DeletionTime", "description": "Description.VerifiedAccountGroup.Description", "last_updated_time": "Description.VerifiedAccountGroup.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "owner": "Description.VerifiedAccountGroup.Owner", "tags_src": "Description.VerifiedAccountGroup.Tags", "verified_access_group_id": "Description.VerifiedAccountGroup.VerifiedAccessGroupId", @@ -19885,6 +20143,7 @@ var getEC2VerifiedAccessGroupFilters = map[string]string{ "deletion_time": "Description.VerifiedAccountGroup.DeletionTime", "description": "Description.VerifiedAccountGroup.Description", "last_updated_time": "Description.VerifiedAccountGroup.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "owner": "Description.VerifiedAccountGroup.Owner", "tags_src": "Description.VerifiedAccountGroup.Tags", "verified_access_group_id": "description.VerifiedAccountEndpoint.VerifiedAccessGroupId", @@ -19952,6 +20211,7 @@ type EC2VerifiedAccessTrustProvider struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VerifiedAccessTrustProviderDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -20030,6 +20290,7 @@ var listEC2VerifiedAccessTrustProviderFilters = map[string]string{ "description": "Description.VerifiedAccountGroup.Description", "device_trust_provider_type": "Description.VerifiedAccountGroup.DeviceTrustProviderType", "last_updated_time": "Description.VerifiedAccountGroup.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "oidc_options": "Description.VerifiedAccountGroup.OidcOptions", "policy_reference_name": "Description.VerifiedAccountGroup.PolicyReferenceName", "tags_src": "Description.VerifiedAccountGroup.Tags", @@ -20103,6 +20364,7 @@ var getEC2VerifiedAccessTrustProviderFilters = map[string]string{ "description": "Description.VerifiedAccountGroup.Description", "device_trust_provider_type": "Description.VerifiedAccountGroup.DeviceTrustProviderType", "last_updated_time": "Description.VerifiedAccountGroup.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "oidc_options": "Description.VerifiedAccountGroup.OidcOptions", "policy_reference_name": "Description.VerifiedAccountGroup.PolicyReferenceName", "tags_src": "Description.VerifiedAccountGroup.Tags", @@ -20172,6 +20434,7 @@ type EC2VPNGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VPNGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -20248,6 +20511,7 @@ func (p EC2VPNGatewayPaginator) NextPage(ctx context.Context) ([]EC2VPNGateway, var listEC2VPNGatewayFilters = map[string]string{ "amazon_side_asn": "description.VPNGateway.AmazonSideAsn", "availability_zone": "description.VPNGateway.AvailabilityZone", + "og_account_id": "metadata.IntegrationID", "state": "description.VPNGateway.State", "tags_src": "Description.VPNGateway.Tags", "type": "description.VPNGateway.Type", @@ -20318,6 +20582,7 @@ func ListEC2VPNGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydra var getEC2VPNGatewayFilters = map[string]string{ "amazon_side_asn": "Description.VPNGateway.AmazonSideAsn", "availability_zone": "Description.VPNGateway.AvailabilityZone", + "og_account_id": "metadata.IntegrationID", "state": "Description.VPNGateway.State", "tags_src": "Description.VPNGateway.Tags", "type": "Description.VPNGateway.Type", @@ -20386,6 +20651,7 @@ type EC2Volume struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VolumeDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -20470,6 +20736,7 @@ var listEC2VolumeFilters = map[string]string{ "iops": "Description.Volume.Iops", "kms_key_id": "Description.Volume.KmsKeyId", "multi_attach_enabled": "Description.Volume.MultiAttachEnabled", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.Volume.OutpostArn", "product_codes": "Description.Attributes.ProductCodes", "size": "Description.Volume.Size", @@ -20551,6 +20818,7 @@ var getEC2VolumeFilters = map[string]string{ "iops": "Description.Volume.Iops", "kms_key_id": "Description.Volume.KmsKeyId", "multi_attach_enabled": "Description.Volume.MultiAttachEnabled", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.Volume.OutpostArn", "product_codes": "Description.Attributes.ProductCodes", "size": "Description.Volume.Size", @@ -20622,6 +20890,7 @@ type EC2ClientVpnEndpoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2ClientVpnEndpointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -20707,6 +20976,7 @@ var listEC2ClientVpnEndpointFilters = map[string]string{ "description": "Description.ClientVpnEndpoint.Description", "dns_name": "Description.ClientVpnEndpoint.DnsName", "dns_servers": "Description.ClientVpnEndpoint.DnsServers", + "og_account_id": "metadata.IntegrationID", "security_group_ids": "Description.ClientVpnEndpoint.SecurityGroupIds", "self_service_portal_url": "Description.ClientVpnEndpoint.SelfServicePortalUrl", "server_certificate_arn": "Description.ClientVpnEndpoint.ServerCertificateArn", @@ -20792,6 +21062,7 @@ var getEC2ClientVpnEndpointFilters = map[string]string{ "description": "Description.ClientVpnEndpoint.Description", "dns_name": "Description.ClientVpnEndpoint.DnsName", "dns_servers": "Description.ClientVpnEndpoint.DnsServers", + "og_account_id": "metadata.IntegrationID", "security_group_ids": "Description.ClientVpnEndpoint.SecurityGroupIds", "self_service_portal_url": "Description.ClientVpnEndpoint.SelfServicePortalUrl", "server_certificate_arn": "Description.ClientVpnEndpoint.ServerCertificateArn", @@ -20867,6 +21138,7 @@ type EC2Instance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2InstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -20977,6 +21249,7 @@ var listEC2InstanceFilters = map[string]string{ "metadata_options": "Description.Instance.MetadataOptions", "monitoring_state": "description.Instance.Monitoring.State", "network_interfaces": "Description.Instance.NetworkInterfaces", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "description.Instance.OutpostArn", "placement_affinity": "Description.Instance.Placement.Affinity", "placement_availability_zone": "description.Instance.Placement.AvailabilityZone", @@ -21109,6 +21382,7 @@ var getEC2InstanceFilters = map[string]string{ "metadata_options": "Description.Instance.MetadataOptions", "monitoring_state": "Description.Instance.Monitoring.State", "network_interfaces": "Description.Instance.NetworkInterfaces", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.Instance.OutpostArn", "placement_affinity": "Description.Instance.Placement.Affinity", "placement_availability_zone": "Description.Instance.Placement.AvailabilityZone", @@ -21205,6 +21479,7 @@ type EC2Vpc struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VpcDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -21286,6 +21561,7 @@ var listEC2VpcFilters = map[string]string{ "instance_tenancy": "Description.Vpc.InstanceTenancy", "ipv6_cidr_block_association_set": "Description.Vpc.Ipv6CidrBlockAssociationSet", "is_default": "Description.Vpc.IsDefault", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.Vpc.OwnerId", "state": "Description.Vpc.State", "tags_src": "Description.Vpc.Tags", @@ -21360,6 +21636,7 @@ var getEC2VpcFilters = map[string]string{ "instance_tenancy": "Description.Vpc.InstanceTenancy", "ipv6_cidr_block_association_set": "Description.Vpc.Ipv6CidrBlockAssociationSet", "is_default": "Description.Vpc.IsDefault", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.Vpc.OwnerId", "state": "Description.Vpc.State", "tags_src": "Description.Vpc.Tags", @@ -21427,6 +21704,7 @@ type EC2NetworkInterface struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2NetworkInterfaceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -21522,6 +21800,7 @@ var listEC2NetworkInterfaceFilters = map[string]string{ "ipv6_addresses": "Description.NetworkInterface.Ipv6Addresses", "mac_address": "Description.NetworkInterface.MacAddress", "network_interface_id": "Description.NetworkInterface.NetworkInterfaceId", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.NetworkInterface.OutpostArn", "owner_id": "Description.NetworkInterface.OwnerId", "private_dns_name": "Description.NetworkInterface.PrivateDnsName", @@ -21619,6 +21898,7 @@ var getEC2NetworkInterfaceFilters = map[string]string{ "ipv6_addresses": "Description.NetworkInterface.Ipv6Addresses", "mac_address": "Description.NetworkInterface.MacAddress", "network_interface_id": "description.NetworkInterface.NetworkInterfaceId", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.NetworkInterface.OutpostArn", "owner_id": "Description.NetworkInterface.OwnerId", "private_dns_name": "Description.NetworkInterface.PrivateDnsName", @@ -21695,6 +21975,7 @@ type EC2RegionalSettings struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2RegionalSettingsDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -21771,6 +22052,7 @@ func (p EC2RegionalSettingsPaginator) NextPage(ctx context.Context) ([]EC2Region var listEC2RegionalSettingsFilters = map[string]string{ "default_ebs_encryption_enabled": "Description.EbsEncryptionByDefault", "default_ebs_encryption_key": "Description.KmsKeyId", + "og_account_id": "metadata.IntegrationID", "snapshot_block_public_access_state": "Description.SnapshotBlockPublicAccessState", } @@ -21837,6 +22119,7 @@ func ListEC2RegionalSettings(ctx context.Context, d *plugin.QueryData, _ *plugin var getEC2RegionalSettingsFilters = map[string]string{ "default_ebs_encryption_enabled": "Description.EbsEncryptionByDefault", "default_ebs_encryption_key": "Description.KmsKeyId", + "og_account_id": "metadata.IntegrationID", "snapshot_block_public_access_state": "Description.SnapshotBlockPublicAccessState", } @@ -21901,6 +22184,7 @@ type EC2Subnet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2SubnetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -21985,6 +22269,7 @@ var listEC2SubnetFilters = map[string]string{ "ipv6_cidr_block_association_set": "Description.Subnet.Ipv6CidrBlockAssociationSet", "map_customer_owned_ip_on_launch": "Description.Subnet.MapCustomerOwnedIpOnLaunch", "map_public_ip_on_launch": "Description.Subnet.MapPublicIpOnLaunch", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.Subnet.OutpostArn", "owner_id": "Description.Subnet.OwnerId", "state": "Description.Subnet.State", @@ -22065,6 +22350,7 @@ var getEC2SubnetFilters = map[string]string{ "ipv6_cidr_block_association_set": "Description.Subnet.Ipv6CidrBlockAssociationSet", "map_customer_owned_ip_on_launch": "Description.Subnet.MapCustomerOwnedIpOnLaunch", "map_public_ip_on_launch": "Description.Subnet.MapPublicIpOnLaunch", + "og_account_id": "metadata.IntegrationID", "outpost_arn": "Description.Subnet.OutpostArn", "owner_id": "Description.Subnet.OwnerId", "state": "Description.Subnet.State", @@ -22135,6 +22421,7 @@ type EC2VPCEndpoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VPCEndpointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -22213,6 +22500,7 @@ var listEC2VPCEndpointFilters = map[string]string{ "dns_entries": "Description.VpcEndpoint.DnsEntries", "groups": "Description.VpcEndpoint.Groups", "network_interface_ids": "Description.VpcEndpoint.NetworkInterfaceIds", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.VpcEndpoint.OwnerId", "private_dns_enabled": "Description.VpcEndpoint.PrivateDnsEnabled", "requester_managed": "Description.VpcEndpoint.RequesterManaged", @@ -22291,6 +22579,7 @@ var getEC2VPCEndpointFilters = map[string]string{ "dns_entries": "Description.VpcEndpoint.DnsEntries", "groups": "Description.VpcEndpoint.Groups", "network_interface_ids": "Description.VpcEndpoint.NetworkInterfaceIds", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.VpcEndpoint.OwnerId", "private_dns_enabled": "Description.VpcEndpoint.PrivateDnsEnabled", "requester_managed": "Description.VpcEndpoint.RequesterManaged", @@ -22365,6 +22654,7 @@ type EC2SecurityGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2SecurityGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -22445,6 +22735,7 @@ var listEC2SecurityGroupFilters = map[string]string{ "group_name": "Description.SecurityGroup.GroupName", "ip_permissions": "Description.SecurityGroup.IpPermissions", "ip_permissions_egress": "Description.SecurityGroup.IpPermissionsEgress", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.SecurityGroup.OwnerId", "tags_src": "Description.SecurityGroup.Tags", "title": "Description.SecurityGroup.GroupName", @@ -22518,6 +22809,7 @@ var getEC2SecurityGroupFilters = map[string]string{ "group_name": "Description.SecurityGroup.GroupName", "ip_permissions": "Description.SecurityGroup.IpPermissions", "ip_permissions_egress": "Description.SecurityGroup.IpPermissionsEgress", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.SecurityGroup.OwnerId", "tags_src": "Description.SecurityGroup.Tags", "title": "Description.SecurityGroup.GroupName", @@ -22585,6 +22877,7 @@ type EC2EIP struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2EIPDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -22670,6 +22963,7 @@ var listEC2EIPFilters = map[string]string{ "network_border_group": "Description.Address.NetworkBorderGroup", "network_interface_id": "Description.Address.NetworkInterfaceId", "network_interface_owner_id": "Description.Address.NetworkInterfaceOwnerId", + "og_account_id": "metadata.IntegrationID", "private_ip_address": "Description.Address.PrivateIpAddress", "public_ip": "Description.Address.PublicIp", "public_ipv4_pool": "Description.Address.PublicIpv4Pool", @@ -22749,6 +23043,7 @@ var getEC2EIPFilters = map[string]string{ "network_border_group": "Description.Address.NetworkBorderGroup", "network_interface_id": "Description.Address.NetworkInterfaceId", "network_interface_owner_id": "Description.Address.NetworkInterfaceOwnerId", + "og_account_id": "metadata.IntegrationID", "private_ip_address": "Description.Address.PrivateIpAddress", "public_ip": "Description.Address.PublicIp", "public_ipv4_pool": "Description.Address.PublicIpv4Pool", @@ -22817,6 +23112,7 @@ type EC2InternetGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2InternetGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -22893,6 +23189,7 @@ func (p EC2InternetGatewayPaginator) NextPage(ctx context.Context) ([]EC2Interne var listEC2InternetGatewayFilters = map[string]string{ "attachments": "Description.InternetGateway.Attachments", "internet_gateway_id": "Description.InternetGateway.InternetGatewayId", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.InternetGateway.OwnerId", "tags_src": "Description.InternetGateway.Tags", } @@ -22960,6 +23257,7 @@ func ListEC2InternetGateway(ctx context.Context, d *plugin.QueryData, _ *plugin. var getEC2InternetGatewayFilters = map[string]string{ "attachments": "Description.InternetGateway.Attachments", "internet_gateway_id": "description.InternetGateway.InternetGatewayId", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.InternetGateway.OwnerId", "tags_src": "Description.InternetGateway.Tags", } @@ -23025,6 +23323,7 @@ type EC2NetworkAcl struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2NetworkAclDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -23104,6 +23403,7 @@ var listEC2NetworkAclFilters = map[string]string{ "entries": "Description.NetworkAcl.Entries", "is_default": "Description.NetworkAcl.IsDefault", "network_acl_id": "Description.NetworkAcl.NetworkAclId", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.NetworkAcl.OwnerId", "tags_src": "Description.NetworkAcl.Tags", "vpc_id": "Description.NetworkAcl.VpcId", @@ -23175,6 +23475,7 @@ var getEC2NetworkAclFilters = map[string]string{ "entries": "Description.NetworkAcl.Entries", "is_default": "Description.NetworkAcl.IsDefault", "network_acl_id": "description.NetworkAcl.NetworkAclId", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.NetworkAcl.OwnerId", "tags_src": "Description.NetworkAcl.Tags", "vpc_id": "Description.NetworkAcl.VpcId", @@ -23241,6 +23542,7 @@ type EC2VPNConnection struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VPNConnectionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -23319,6 +23621,7 @@ var listEC2VPNConnectionFilters = map[string]string{ "category": "Description.VpnConnection.Category", "customer_gateway_configuration": "Description.VpnConnection.CustomerGatewayConfiguration", "customer_gateway_id": "Description.VpnConnection.CustomerGatewayId", + "og_account_id": "metadata.IntegrationID", "options": "Description.VpnConnection.Options", "routes": "Description.VpnConnection.Routes", "state": "Description.VpnConnection.State", @@ -23395,6 +23698,7 @@ var getEC2VPNConnectionFilters = map[string]string{ "category": "Description.VpnConnection.Category", "customer_gateway_configuration": "Description.VpnConnection.CustomerGatewayConfiguration", "customer_gateway_id": "Description.VpnConnection.CustomerGatewayId", + "og_account_id": "metadata.IntegrationID", "options": "Description.VpnConnection.Options", "routes": "Description.VpnConnection.Routes", "state": "Description.VpnConnection.State", @@ -23467,6 +23771,7 @@ type EC2RouteTable struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2RouteTableDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -23542,6 +23847,7 @@ func (p EC2RouteTablePaginator) NextPage(ctx context.Context) ([]EC2RouteTable, var listEC2RouteTableFilters = map[string]string{ "associations": "Description.RouteTable.Associations", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.RouteTable.OwnerId", "propagating_vgws": "Description.RouteTable.PropagatingVgws", "route_table_id": "Description.RouteTable.RouteTableId", @@ -23613,6 +23919,7 @@ func ListEC2RouteTable(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydra var getEC2RouteTableFilters = map[string]string{ "associations": "Description.RouteTable.Associations", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.RouteTable.OwnerId", "propagating_vgws": "Description.RouteTable.PropagatingVgws", "route_table_id": "description.RouteTable.RouteTableId", @@ -23683,6 +23990,7 @@ type EC2NatGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2NatGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -23764,6 +24072,7 @@ var listEC2NatGatewayFilters = map[string]string{ "failure_message": "Description.NatGateway.FailureMessage", "nat_gateway_addresses": "Description.NatGateway.NatGatewayAddresses", "nat_gateway_id": "Description.NatGateway.NatGatewayId", + "og_account_id": "metadata.IntegrationID", "provisioned_bandwidth": "Description.NatGateway.ProvisionedBandwidth", "state": "Description.NatGateway.State", "subnet_id": "Description.NatGateway.SubnetId", @@ -23839,6 +24148,7 @@ var getEC2NatGatewayFilters = map[string]string{ "failure_message": "Description.NatGateway.FailureMessage", "nat_gateway_addresses": "Description.NatGateway.NatGatewayAddresses", "nat_gateway_id": "description.NatGateway.NatGatewayId", + "og_account_id": "metadata.IntegrationID", "provisioned_bandwidth": "Description.NatGateway.ProvisionedBandwidth", "state": "Description.NatGateway.State", "subnet_id": "Description.NatGateway.SubnetId", @@ -23907,6 +24217,7 @@ type EC2LocalGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2LocalGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -23981,9 +24292,10 @@ func (p EC2LocalGatewayPaginator) NextPage(ctx context.Context) ([]EC2LocalGatew } var listEC2LocalGatewayFilters = map[string]string{ - "arn": "ARN", - "id": "Description.LocalGateway.LocalGatewayId", - "title": "Description.LocalGateway.LocalGatewayId", + "arn": "ARN", + "id": "Description.LocalGateway.LocalGatewayId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.LocalGateway.LocalGatewayId", } func ListEC2LocalGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -24047,9 +24359,10 @@ func ListEC2LocalGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd } var getEC2LocalGatewayFilters = map[string]string{ - "arn": "ARN", - "id": "description.LocalGateway.LocalGatewayId", - "title": "Description.LocalGateway.LocalGatewayId", + "arn": "ARN", + "id": "description.LocalGateway.LocalGatewayId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.LocalGateway.LocalGatewayId", } func GetEC2LocalGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -24113,6 +24426,7 @@ type EC2Region struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2RegionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -24188,6 +24502,7 @@ func (p EC2RegionPaginator) NextPage(ctx context.Context) ([]EC2Region, error) { var listEC2RegionFilters = map[string]string{ "name": "Description.Region.RegionName", + "og_account_id": "metadata.IntegrationID", "opt_in_status": "Description.Region.OptInStatus", "partition": "Metadata.Partition", "region": "Description.Region.RegionName", @@ -24256,6 +24571,7 @@ func ListEC2Region(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDa var getEC2RegionFilters = map[string]string{ "name": "description.Region.RegionName", + "og_account_id": "metadata.IntegrationID", "opt_in_status": "Description.Region.OptInStatus", "partition": "Metadata.Partition", "region": "Description.Region.RegionName", @@ -24323,6 +24639,7 @@ type EC2AvailabilityZone struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2AvailabilityZoneDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -24400,6 +24717,7 @@ var listEC2AvailabilityZoneFilters = map[string]string{ "group_name": "Description.AvailabilityZone.GroupName", "messages": "Description.AvailabilityZone.Messages", "name": "description.AvailabilityZone.ZoneName", + "og_account_id": "metadata.IntegrationID", "opt_in_status": "Description.AvailabilityZone.OptInStatus", "parent_zone_id": "Description.AvailabilityZone.ParentZoneId", "parent_zone_name": "Description.AvailabilityZone.ParentZoneName", @@ -24473,6 +24791,7 @@ var getEC2AvailabilityZoneFilters = map[string]string{ "group_name": "Description.AvailabilityZone.GroupName", "messages": "Description.AvailabilityZone.Messages", "name": "description.AvailabilityZone.ZoneName", + "og_account_id": "metadata.IntegrationID", "opt_in_status": "Description.AvailabilityZone.OptInStatus", "parent_zone_id": "Description.AvailabilityZone.ParentZoneId", "parent_zone_name": "Description.AvailabilityZone.ParentZoneName", @@ -24543,6 +24862,7 @@ type EC2FlowLog struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2FlowLogDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -24628,6 +24948,7 @@ var listEC2FlowLogFilters = map[string]string{ "log_format": "Description.FlowLog.LogFormat", "log_group_name": "Description.FlowLog.LogGroupName", "max_aggregation_interval": "Description.FlowLog.MaxAggregationInterval", + "og_account_id": "metadata.IntegrationID", "resource_id": "Description.FlowLog.ResourceId", "tags_src": "Description.FlowLog.Tags", "traffic_type": "Description.FlowLog.TrafficType", @@ -24705,6 +25026,7 @@ var getEC2FlowLogFilters = map[string]string{ "log_format": "Description.FlowLog.LogFormat", "log_group_name": "Description.FlowLog.LogGroupName", "max_aggregation_interval": "Description.FlowLog.MaxAggregationInterval", + "og_account_id": "metadata.IntegrationID", "resource_id": "Description.FlowLog.ResourceId", "tags_src": "Description.FlowLog.Tags", "traffic_type": "Description.FlowLog.TrafficType", @@ -24771,6 +25093,7 @@ type EC2CapacityReservation struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2CapacityReservationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -24858,6 +25181,7 @@ var listEC2CapacityReservationFilters = map[string]string{ "instance_match_criteria": "Description.CapacityReservation.InstanceMatchCriteria", "instance_platform": "Description.CapacityReservation.InstancePlatform", "instance_type": "Description.CapacityReservation.InstanceType", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.CapacityReservation.OwnerId", "start_date": "Description.CapacityReservation.StartDate", "state": "Description.CapacityReservation.State", @@ -24941,6 +25265,7 @@ var getEC2CapacityReservationFilters = map[string]string{ "instance_match_criteria": "Description.CapacityReservation.InstanceMatchCriteria", "instance_platform": "Description.CapacityReservation.InstancePlatform", "instance_type": "Description.CapacityReservation.InstanceType", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.CapacityReservation.OwnerId", "start_date": "Description.CapacityReservation.StartDate", "state": "Description.CapacityReservation.State", @@ -25011,6 +25336,7 @@ type EC2KeyPair struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2KeyPairDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -25089,6 +25415,7 @@ var listEC2KeyPairFilters = map[string]string{ "key_fingerprint": "Description.KeyPair.KeyFingerprint", "key_name": "Description.KeyPair.KeyName", "key_pair_id": "Description.KeyPair.KeyPairId", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.KeyPair.Tags", "title": "Description.KeyPair.KeyName", } @@ -25158,6 +25485,7 @@ var getEC2KeyPairFilters = map[string]string{ "key_fingerprint": "Description.KeyPair.KeyFingerprint", "key_name": "description.KeyPair.KeyName", "key_pair_id": "Description.KeyPair.KeyPairId", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.KeyPair.Tags", "title": "Description.KeyPair.KeyName", } @@ -25223,6 +25551,7 @@ type EC2AMI struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2AMIDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -25311,6 +25640,7 @@ var listEC2AMIFilters = map[string]string{ "kernel_id": "Description.AMI.KernelId", "launch_permissions": "Description.LaunchPermissions", "name": "Description.AMI.Name", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.AMI.OwnerId", "platform": "Description.AMI.Platform", "platform_details": "Description.AMI.PlatformDetails", @@ -25401,6 +25731,7 @@ var getEC2AMIFilters = map[string]string{ "kernel_id": "Description.AMI.KernelId", "launch_permissions": "Description.LaunchPermissions", "name": "Description.AMI.Name", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.AMI.OwnerId", "platform": "Description.AMI.Platform", "platform_details": "Description.AMI.PlatformDetails", @@ -25477,6 +25808,7 @@ type EC2ReservedInstances struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2ReservedInstancesDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -25563,6 +25895,7 @@ var listEC2ReservedInstancesFilters = map[string]string{ "instance_type": "Description.ReservedInstances.InstanceType", "offering_class": "Description.ReservedInstances.OfferingClass", "offering_type": "Description.ReservedInstances.OfferingType", + "og_account_id": "metadata.IntegrationID", "product_description": "Description.ReservedInstances.ProductDescription", "reserved_instance_id": "Description.ReservedInstances.ReservedInstancesId", "reserved_instances_modifications": "Description.ModificationDetails", @@ -25646,6 +25979,7 @@ var getEC2ReservedInstancesFilters = map[string]string{ "instance_type": "Description.ReservedInstances.InstanceType", "offering_class": "Description.ReservedInstances.OfferingClass", "offering_type": "Description.ReservedInstances.OfferingType", + "og_account_id": "metadata.IntegrationID", "product_description": "Description.ReservedInstances.ProductDescription", "reserved_instance_id": "description.ReservedInstance.ReservedInstancesId", "reserved_instances_modifications": "Description.ModificationDetails", @@ -25717,6 +26051,7 @@ type EC2CapacityReservationFleet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2CapacityReservationFleetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -25793,6 +26128,7 @@ func (p EC2CapacityReservationFleetPaginator) NextPage(ctx context.Context) ([]E var listEC2CapacityReservationFleetFilters = map[string]string{ "capacity_reservation_fleet_arn": "Description.CapacityReservationFleet.CapacityReservationFleetArn", "capacity_reservation_fleet_id": "Description.CapacityReservationFleet.CapacityReservationFleetId", + "og_account_id": "metadata.IntegrationID", "title": "Description.CapacityReservationFleet.CapacityReservationFleetId", } @@ -25859,6 +26195,7 @@ func ListEC2CapacityReservationFleet(ctx context.Context, d *plugin.QueryData, _ var getEC2CapacityReservationFleetFilters = map[string]string{ "capacity_reservation_fleet_arn": "Description.CapacityReservationFleet.CapacityReservationFleetArn", "capacity_reservation_fleet_id": "description.CapacityReservationFleet.CapacityReservationFleetId", + "og_account_id": "metadata.IntegrationID", "title": "Description.CapacityReservationFleet.CapacityReservationFleetId", } @@ -25923,6 +26260,7 @@ type EC2Fleet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2FleetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -25997,9 +26335,10 @@ func (p EC2FleetPaginator) NextPage(ctx context.Context) ([]EC2Fleet, error) { } var listEC2FleetFilters = map[string]string{ - "fleet_arn": "ARN", - "fleet_id": "Description.Fleet.FleetId", - "title": "Description.Fleet.FleetId", + "fleet_arn": "ARN", + "fleet_id": "Description.Fleet.FleetId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Fleet.FleetId", } func ListEC2Fleet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -26063,9 +26402,10 @@ func ListEC2Fleet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDat } var getEC2FleetFilters = map[string]string{ - "fleet_arn": "ARN", - "fleet_id": "description.Fleet.FleetId", - "title": "Description.Fleet.FleetId", + "fleet_arn": "ARN", + "fleet_id": "description.Fleet.FleetId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Fleet.FleetId", } func GetEC2Fleet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -26129,6 +26469,7 @@ type EC2Host struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2HostDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -26203,9 +26544,10 @@ func (p EC2HostPaginator) NextPage(ctx context.Context) ([]EC2Host, error) { } var listEC2HostFilters = map[string]string{ - "host_arn": "ARN", - "host_id": "Description.Host.HostId", - "title": "Description.Host.HostId", + "host_arn": "ARN", + "host_id": "Description.Host.HostId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Host.HostId", } func ListEC2Host(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -26269,9 +26611,10 @@ func ListEC2Host(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData } var getEC2HostFilters = map[string]string{ - "host_arn": "ARN", - "host_id": "description.Host.HostId", - "title": "Description.Host.HostId", + "host_arn": "ARN", + "host_id": "description.Host.HostId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Host.HostId", } func GetEC2Host(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -26335,6 +26678,7 @@ type EC2PlacementGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2PlacementGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -26409,10 +26753,11 @@ func (p EC2PlacementGroupPaginator) NextPage(ctx context.Context) ([]EC2Placemen } var listEC2PlacementGroupFilters = map[string]string{ - "arn": "ARN", - "group_id": "Description.PlacementGroup.GroupId", - "group_name": "Description.PlacementGroup.GroupName", - "title": "Description.PlacementGroup.GroupName", + "arn": "ARN", + "group_id": "Description.PlacementGroup.GroupId", + "group_name": "Description.PlacementGroup.GroupName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.PlacementGroup.GroupName", } func ListEC2PlacementGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -26476,10 +26821,11 @@ func ListEC2PlacementGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.H } var getEC2PlacementGroupFilters = map[string]string{ - "arn": "ARN", - "group_id": "Description.PlacementGroup.GroupId", - "group_name": "description.PlacementGroup.GroupName", - "title": "Description.PlacementGroup.GroupName", + "arn": "ARN", + "group_id": "Description.PlacementGroup.GroupId", + "group_name": "description.PlacementGroup.GroupName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.PlacementGroup.GroupName", } func GetEC2PlacementGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -26543,6 +26889,7 @@ type EC2TransitGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2TransitGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -26627,6 +26974,7 @@ var listEC2TransitGatewayFilters = map[string]string{ "description": "Description.TransitGateway.Description", "dns_support": "Description.TransitGateway.Options.DnsSupport", "multicast_support": "Description.TransitGateway.Options.MulticastSupport", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.TransitGateway.OwnerId", "propagation_default_route_table_id": "Description.TransitGateway.Options.PropagationDefaultRouteTableId", "state": "Description.TransitGateway.State", @@ -26707,6 +27055,7 @@ var getEC2TransitGatewayFilters = map[string]string{ "description": "Description.TransitGateway.Description", "dns_support": "Description.TransitGateway.Options.DnsSupport", "multicast_support": "Description.TransitGateway.Options.MulticastSupport", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.TransitGateway.OwnerId", "propagation_default_route_table_id": "Description.TransitGateway.Options.PropagationDefaultRouteTableId", "state": "Description.TransitGateway.State", @@ -26777,6 +27126,7 @@ type EC2TransitGatewayRouteTable struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2TransitGatewayRouteTableDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -26854,6 +27204,7 @@ var listEC2TransitGatewayRouteTableFilters = map[string]string{ "creation_time": "Description.TransitGatewayRouteTable.CreationTime", "default_association_route_table": "Description.TransitGatewayRouteTable.DefaultAssociationRouteTable", "default_propagation_route_table": "Description.TransitGatewayRouteTable.DefaultPropagationRouteTable", + "og_account_id": "metadata.IntegrationID", "state": "Description.TransitGatewayRouteTable.State", "tags_src": "Description.TransitGatewayRouteTable.Tags", "transit_gateway_id": "Description.TransitGatewayRouteTable.TransitGatewayId", @@ -26924,6 +27275,7 @@ var getEC2TransitGatewayRouteTableFilters = map[string]string{ "creation_time": "Description.TransitGatewayRouteTable.CreationTime", "default_association_route_table": "Description.TransitGatewayRouteTable.DefaultAssociationRouteTable", "default_propagation_route_table": "Description.TransitGatewayRouteTable.DefaultPropagationRouteTable", + "og_account_id": "metadata.IntegrationID", "state": "Description.TransitGatewayRouteTable.State", "tags_src": "Description.TransitGatewayRouteTable.Tags", "transit_gateway_id": "Description.TransitGatewayRouteTable.TransitGatewayId", @@ -26991,6 +27343,7 @@ type EC2DhcpOptions struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2DhcpOptionsDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -27071,6 +27424,7 @@ var listEC2DhcpOptionsFilters = map[string]string{ "netbios_name_servers": "Description.DhcpOptions.DhcpConfigurations", "netbios_node_type": "Description.DhcpOptions.DhcpConfigurations", "ntp_servers": "Description.DhcpOptions.DhcpConfigurations", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.DhcpOptions.OwnerId", "tags_src": "Description.DhcpOptions.Tags", } @@ -27142,6 +27496,7 @@ var getEC2DhcpOptionsFilters = map[string]string{ "netbios_name_servers": "Description.DhcpOptions.DhcpConfigurations", "netbios_node_type": "Description.DhcpOptions.DhcpConfigurations", "ntp_servers": "Description.DhcpOptions.DhcpConfigurations", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.DhcpOptions.OwnerId", "tags_src": "Description.DhcpOptions.Tags", } @@ -27207,6 +27562,7 @@ type EC2EgressOnlyInternetGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2EgressOnlyInternetGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -27281,9 +27637,10 @@ func (p EC2EgressOnlyInternetGatewayPaginator) NextPage(ctx context.Context) ([] } var listEC2EgressOnlyInternetGatewayFilters = map[string]string{ - "attachments": "Description.EgressOnlyInternetGateway.Attachments", - "id": "Description.EgressOnlyInternetGateway.EgressOnlyInternetGatewayId", - "tags_src": "Description.EgressOnlyInternetGateway.Tags", + "attachments": "Description.EgressOnlyInternetGateway.Attachments", + "id": "Description.EgressOnlyInternetGateway.EgressOnlyInternetGatewayId", + "og_account_id": "metadata.IntegrationID", + "tags_src": "Description.EgressOnlyInternetGateway.Tags", } func ListEC2EgressOnlyInternetGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -27347,9 +27704,10 @@ func ListEC2EgressOnlyInternetGateway(ctx context.Context, d *plugin.QueryData, } var getEC2EgressOnlyInternetGatewayFilters = map[string]string{ - "attachments": "Description.EgressOnlyInternetGateway.Attachments", - "id": "description.EgressOnlyInternetGateway.EgressOnlyInternetGatewayId", - "tags_src": "Description.EgressOnlyInternetGateway.Tags", + "attachments": "Description.EgressOnlyInternetGateway.Attachments", + "id": "description.EgressOnlyInternetGateway.EgressOnlyInternetGatewayId", + "og_account_id": "metadata.IntegrationID", + "tags_src": "Description.EgressOnlyInternetGateway.Tags", } func GetEC2EgressOnlyInternetGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -27413,6 +27771,7 @@ type EC2VpcPeeringConnection struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VpcPeeringConnectionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -27496,6 +27855,7 @@ var listEC2VpcPeeringConnectionFilters = map[string]string{ "accepter_vpc_id": "Description.VpcPeeringConnection.AccepterVpcInfo.VpcId", "expiration_time": "Description.VpcPeeringConnection.ExpirationTime", "id": "Description.VpcPeeringConnection.VpcPeeringConnectionId", + "og_account_id": "metadata.IntegrationID", "requester_cidr_block": "Description.VpcPeeringConnection.RequesterVpcInfo.CidrBlock", "requester_cidr_block_set": "Description.VpcPeeringConnection.RequesterVpcInfo.CidrBlockSet", "requester_ipv6_cidr_block_set": "Description.VpcPeeringConnection.RequesterVpcInfo.Ipv6CidrBlockSet", @@ -27579,6 +27939,7 @@ var getEC2VpcPeeringConnectionFilters = map[string]string{ "accepter_vpc_id": "Description.VpcPeeringConnection.AccepterVpcInfo.VpcId", "expiration_time": "Description.VpcPeeringConnection.ExpirationTime", "id": "Description.VpcPeeringConnection.VpcPeeringConnectionId", + "og_account_id": "metadata.IntegrationID", "requester_cidr_block": "Description.VpcPeeringConnection.RequesterVpcInfo.CidrBlock", "requester_cidr_block_set": "Description.VpcPeeringConnection.RequesterVpcInfo.CidrBlockSet", "requester_ipv6_cidr_block_set": "Description.VpcPeeringConnection.RequesterVpcInfo.Ipv6CidrBlockSet", @@ -27653,6 +28014,7 @@ type EC2SecurityGroupRule struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2SecurityGroupRuleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -27735,6 +28097,7 @@ var listEC2SecurityGroupRuleFilters = map[string]string{ "group_id": "Description.Group.GroupId", "group_name": "Description.Group.GroupName", "ip_protocol": "Description.Permission.IpProtocol", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.Group.OwnerId", "pair_group_id": "Description.UserIDGroupPair.GroupId", "pair_group_name": "Description.UserIDGroupPair.GroupName", @@ -27823,6 +28186,7 @@ var getEC2SecurityGroupRuleFilters = map[string]string{ "group_id": "Description.Group.GroupId", "group_name": "Description.Group.GroupName", "ip_protocol": "Description.Permission.IpProtocol", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.Group.OwnerId", "pair_group_id": "Description.UserIDGroupPair.GroupId", "pair_group_name": "Description.UserIDGroupPair.GroupName", @@ -27903,6 +28267,7 @@ type EC2IpamPool struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2IpamPoolDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -27977,9 +28342,10 @@ func (p EC2IpamPoolPaginator) NextPage(ctx context.Context) ([]EC2IpamPool, erro } var listEC2IpamPoolFilters = map[string]string{ - "arn": "Description.IpamPool.IpamPoolArn", - "ipam_pool_id": "Description.IpamPool.IpamPoolId", - "title": "Description.IpamPool.IpamPoolId", + "arn": "Description.IpamPool.IpamPoolArn", + "ipam_pool_id": "Description.IpamPool.IpamPoolId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.IpamPool.IpamPoolId", } func ListEC2IpamPool(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -28043,9 +28409,10 @@ func ListEC2IpamPool(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydrate } var getEC2IpamPoolFilters = map[string]string{ - "arn": "Description.IpamPool.IpamPoolArn", - "ipam_pool_id": "description.IpamPool.IpamPoolId", - "title": "Description.IpamPool.IpamPoolId", + "arn": "Description.IpamPool.IpamPoolArn", + "ipam_pool_id": "description.IpamPool.IpamPoolId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.IpamPool.IpamPoolId", } func GetEC2IpamPool(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -28109,6 +28476,7 @@ type EC2Ipam struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2IpamDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -28183,9 +28551,10 @@ func (p EC2IpamPaginator) NextPage(ctx context.Context) ([]EC2Ipam, error) { } var listEC2IpamFilters = map[string]string{ - "arn": "Description.Ipam.IpamArn", - "ipam_id": "Description.Ipam.IpamId", - "title": "Description.Ipam.IpamId", + "arn": "Description.Ipam.IpamArn", + "ipam_id": "Description.Ipam.IpamId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Ipam.IpamId", } func ListEC2Ipam(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -28249,9 +28618,10 @@ func ListEC2Ipam(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData } var getEC2IpamFilters = map[string]string{ - "arn": "Description.Ipam.IpamArn", - "ipam_id": "description.Ipam.IpamId", - "title": "Description.Ipam.IpamId", + "arn": "Description.Ipam.IpamArn", + "ipam_id": "description.Ipam.IpamId", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Ipam.IpamId", } func GetEC2Ipam(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -28315,6 +28685,7 @@ type EC2VPCEndpointService struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2VPCEndpointServiceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -28393,6 +28764,7 @@ var listEC2VPCEndpointServiceFilters = map[string]string{ "availability_zones": "Description.VpcEndpointService.AvailabilityZones", "base_endpoint_dns_names": "Description.VpcEndpointService.BaseEndpointDnsNames", "manages_vpc_endpoints": "Description.VpcEndpointService.ManagesVpcEndpoints", + "og_account_id": "metadata.IntegrationID", "owner": "Description.VpcEndpointService.Owner", "private_dns_name": "Description.VpcEndpointService.PrivateDnsName", "private_dns_name_verification_state": "Description.VpcEndpointService.PrivateDnsNameVerificationState", @@ -28471,6 +28843,7 @@ var getEC2VPCEndpointServiceFilters = map[string]string{ "availability_zones": "Description.VpcEndpointService.AvailabilityZones", "base_endpoint_dns_names": "Description.VpcEndpointService.BaseEndpointDnsNames", "manages_vpc_endpoints": "Description.VpcEndpointService.ManagesVpcEndpoints", + "og_account_id": "metadata.IntegrationID", "owner": "Description.VpcEndpointService.Owner", "private_dns_name": "Description.VpcEndpointService.PrivateDnsName", "private_dns_name_verification_state": "Description.VpcEndpointService.PrivateDnsNameVerificationState", @@ -28545,6 +28918,7 @@ type EC2InstanceAvailability struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2InstanceAvailabilityDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -28622,6 +28996,7 @@ var listEC2InstanceAvailabilityFilters = map[string]string{ "instance_type": "description.InstanceAvailability.InstanceType", "location": "Description.InstanceAvailability.Location", "location_type": "Description.InstanceAvailability.LocationType", + "og_account_id": "metadata.IntegrationID", "title": "Description.InstanceAvailability.InstanceType", } @@ -28689,6 +29064,7 @@ var getEC2InstanceAvailabilityFilters = map[string]string{ "instance_type": "Description.InstanceAvailability.InstanceType", "location": "Description.InstanceAvailability.Location", "location_type": "Description.InstanceAvailability.LocationType", + "og_account_id": "metadata.IntegrationID", "title": "Description.InstanceAvailability.InstanceType", } @@ -28753,6 +29129,7 @@ type EC2InstanceType struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2InstanceTypeDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -28841,6 +29218,7 @@ var listEC2InstanceTypeFilters = map[string]string{ "instance_type": "Description.InstanceType.InstanceType", "memory_info": "Description.InstanceType.MemoryInfo", "network_info": "Description.InstanceType.NetworkInfo", + "og_account_id": "metadata.IntegrationID", "placement_group_info": "Description.InstanceType.PlacementGroupInfo", "processor_info": "Description.InstanceType.ProcessorInfo", "supported_root_device_types": "Description.InstanceType.SupportedRootDeviceTypes", @@ -28925,6 +29303,7 @@ var getEC2InstanceTypeFilters = map[string]string{ "instance_type": "description.InstanceType.InstanceType", "memory_info": "Description.InstanceType.MemoryInfo", "network_info": "Description.InstanceType.NetworkInfo", + "og_account_id": "metadata.IntegrationID", "placement_group_info": "Description.InstanceType.PlacementGroupInfo", "processor_info": "Description.InstanceType.ProcessorInfo", "supported_root_device_types": "Description.InstanceType.SupportedRootDeviceTypes", @@ -28995,6 +29374,7 @@ type EC2ManagedPrefixList struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2ManagedPrefixListDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -29074,6 +29454,7 @@ var listEC2ManagedPrefixListFilters = map[string]string{ "id": "description.ManagedPrefixList.PrefixListId", "max_entries": "Description.ManagedPrefixList.MaxEntries", "name": "description.ManagedPrefixList.PrefixListName", + "og_account_id": "metadata.IntegrationID", "owner_id": "description.ManagedPrefixList.OwnerId", "state": "Description.ManagedPrefixList.State", "state_message": "Description.ManagedPrefixList.StateMessage", @@ -29148,6 +29529,7 @@ var getEC2ManagedPrefixListFilters = map[string]string{ "id": "Description.ManagedPrefixList.PrefixListId", "max_entries": "Description.ManagedPrefixList.MaxEntries", "name": "Description.ManagedPrefixList.PrefixListName", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.ManagedPrefixList.OwnerId", "state": "Description.ManagedPrefixList.State", "state_message": "Description.ManagedPrefixList.StateMessage", @@ -29217,6 +29599,7 @@ type EC2ManagedPrefixListEntry struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2ManagedPrefixListEntryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -29291,6 +29674,7 @@ func (p EC2ManagedPrefixListEntryPaginator) NextPage(ctx context.Context) ([]EC2 } var listEC2ManagedPrefixListEntryFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "prefix_list_id": "Description.LaunchTemplateVersion.LaunchTemplateName", "title": "Cidr", } @@ -29356,6 +29740,7 @@ func ListEC2ManagedPrefixListEntry(ctx context.Context, d *plugin.QueryData, _ * } var getEC2ManagedPrefixListEntryFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "prefix_list_id": "Description.LaunchTemplateVersion.LaunchTemplateName", "title": "Cidr", } @@ -29421,6 +29806,7 @@ type EC2TransitGatewayRoute struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2TransitGatewayRouteDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -29496,6 +29882,7 @@ func (p EC2TransitGatewayRoutePaginator) NextPage(ctx context.Context) ([]EC2Tra var listEC2TransitGatewayRouteFilters = map[string]string{ "destination_cidr_block": "Description.TransitGatewayRoute.DestinationCidrBlock", + "og_account_id": "metadata.IntegrationID", "prefix_list_id": "description.TransitGatewayRoute.PrefixListId", "state": "description.TransitGatewayRoute.State", "title": "Description.TransitGatewayRoute.DestinationCidrBlock", @@ -29566,6 +29953,7 @@ func ListEC2TransitGatewayRoute(ctx context.Context, d *plugin.QueryData, _ *plu var getEC2TransitGatewayRouteFilters = map[string]string{ "destination_cidr_block": "Description.TransitGatewayRoute.DestinationCidrBlock", + "og_account_id": "metadata.IntegrationID", "prefix_list_id": "Description.TransitGatewayRoute.PrefixListId", "state": "Description.TransitGatewayRoute.State", "title": "Description.TransitGatewayRoute.DestinationCidrBlock", @@ -29635,6 +30023,7 @@ type EC2TransitGatewayAttachment struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2TransitGatewayAttachmentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -29712,6 +30101,7 @@ var listEC2TransitGatewayAttachmentFilters = map[string]string{ "association_state": "description.TransitGatewayAttachment.Association.State", "association_transit_gateway_route_table_id": "description.TransitGatewayAttachment.Association.TransitGatewayRouteTableId", "creation_time": "Description.TransitGatewayAttachment.CreationTime", + "og_account_id": "metadata.IntegrationID", "resource_id": "description.TransitGatewayAttachment.ResourceId", "resource_owner_id": "description.TransitGatewayAttachment.ResourceOwnerId", "resource_type": "description.TransitGatewayAttachment.ResourceType", @@ -29786,6 +30176,7 @@ var getEC2TransitGatewayAttachmentFilters = map[string]string{ "association_state": "Description.TransitGatewayAttachment.Association.State", "association_transit_gateway_route_table_id": "Description.TransitGatewayAttachment.Association.TransitGatewayRouteTableId", "creation_time": "Description.TransitGatewayAttachment.CreationTime", + "og_account_id": "metadata.IntegrationID", "resource_id": "Description.TransitGatewayAttachment.ResourceId", "resource_owner_id": "Description.TransitGatewayAttachment.ResourceOwnerId", "resource_type": "Description.TransitGatewayAttachment.ResourceType", @@ -29857,6 +30248,7 @@ type EC2LaunchTemplate struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2LaunchTemplateDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -30077,6 +30469,7 @@ type EC2LaunchTemplateVersion struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2LaunchTemplateVersionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -30315,6 +30708,7 @@ type EC2InstanceMetricCpuUtilizationHourly struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EC2InstanceMetricCpuUtilizationHourlyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -30531,6 +30925,7 @@ type ElasticLoadBalancingV2SslPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticLoadBalancingV2SslPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -30607,6 +31002,7 @@ func (p ElasticLoadBalancingV2SslPolicyPaginator) NextPage(ctx context.Context) var listElasticLoadBalancingV2SslPolicyFilters = map[string]string{ "ciphers": "Description.SslPolicy.Ciphers", "name": "Description.SslPolicy.Name", + "og_account_id": "metadata.IntegrationID", "ssl_protocols": "Description.SslPolicy.SslProtocols", "title": "Description.SslPolicy.Name", } @@ -30674,6 +31070,7 @@ func ListElasticLoadBalancingV2SslPolicy(ctx context.Context, d *plugin.QueryDat var getElasticLoadBalancingV2SslPolicyFilters = map[string]string{ "ciphers": "Description.SslPolicy.Ciphers", "name": "description.SslPolicy.Name", + "og_account_id": "metadata.IntegrationID", "region": "metadata.Region", "ssl_protocols": "Description.SslPolicy.SslProtocols", "title": "Description.SslPolicy.Name", @@ -30740,6 +31137,7 @@ type ElasticLoadBalancingV2TargetGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticLoadBalancingV2TargetGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -30824,6 +31222,7 @@ var listElasticLoadBalancingV2TargetGroupFilters = map[string]string{ "load_balancer_arns": "Description.TargetGroup.LoadBalancerArns", "matcher_grpc_code": "Description.TargetGroup.Matcher.GrpcCode", "matcher_http_code": "Description.TargetGroup.Matcher.HttpCode", + "og_account_id": "metadata.IntegrationID", "port": "Description.TargetGroup.Port", "protocol": "Description.TargetGroup.Protocol", "tags_src": "Description.Tags", @@ -30907,6 +31306,7 @@ var getElasticLoadBalancingV2TargetGroupFilters = map[string]string{ "load_balancer_arns": "Description.TargetGroup.LoadBalancerArns", "matcher_grpc_code": "Description.TargetGroup.Matcher.GrpcCode", "matcher_http_code": "Description.TargetGroup.Matcher.HttpCode", + "og_account_id": "metadata.IntegrationID", "port": "Description.TargetGroup.Port", "protocol": "Description.TargetGroup.Protocol", "tags_src": "Description.Tags", @@ -30980,6 +31380,7 @@ type ElasticLoadBalancingV2LoadBalancer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticLoadBalancingV2LoadBalancerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -31063,6 +31464,7 @@ var listElasticLoadBalancingV2LoadBalancerFilters = map[string]string{ "ip_address_type": "Description.LoadBalancer.IpAddressType", "load_balancer_attributes": "Description.Attributes", "name": "Description.LoadBalancer.LoadBalancerName", + "og_account_id": "metadata.IntegrationID", "scheme": "Description.LoadBalancer.Scheme", "security_groups": "Description.LoadBalancer.SecurityGroups", "state_code": "Description.LoadBalancer.State.Code", @@ -31143,6 +31545,7 @@ var getElasticLoadBalancingV2LoadBalancerFilters = map[string]string{ "ip_address_type": "Description.LoadBalancer.IpAddressType", "load_balancer_attributes": "Description.Attributes", "name": "Description.LoadBalancer.LoadBalancerName", + "og_account_id": "metadata.IntegrationID", "scheme": "Description.LoadBalancer.Scheme", "security_groups": "Description.LoadBalancer.SecurityGroups", "state_code": "Description.LoadBalancer.State.Code", @@ -31214,6 +31617,7 @@ type ElasticLoadBalancingLoadBalancer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticLoadBalancingLoadBalancerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -31313,6 +31717,7 @@ var listElasticLoadBalancingLoadBalancerFilters = map[string]string{ "lb_cookie_stickiness_policies": "Description.LoadBalancer.Policies.LBCookieStickinessPolicies", "listener_descriptions": "Description.LoadBalancer.ListenerDescriptions", "name": "Description.LoadBalancer.LoadBalancerName", + "og_account_id": "metadata.IntegrationID", "other_policies": "Description.LoadBalancer.Policies.OtherPolicies", "scheme": "Description.LoadBalancer.Scheme", "security_groups": "Description.LoadBalancer.SecurityGroups", @@ -31411,6 +31816,7 @@ var getElasticLoadBalancingLoadBalancerFilters = map[string]string{ "lb_cookie_stickiness_policies": "Description.LoadBalancer.Policies.LBCookieStickinessPolicies", "listener_descriptions": "Description.LoadBalancer.ListenerDescriptions", "name": "description.LoadBalancer.LoadBalancerName", + "og_account_id": "metadata.IntegrationID", "other_policies": "Description.LoadBalancer.Policies.OtherPolicies", "scheme": "Description.LoadBalancer.Scheme", "security_groups": "Description.LoadBalancer.SecurityGroups", @@ -31484,6 +31890,7 @@ type ElasticLoadBalancingV2Listener struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticLoadBalancingV2ListenerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -31563,6 +31970,7 @@ var listElasticLoadBalancingV2ListenerFilters = map[string]string{ "certificates": "Description.Listener.Certificates", "default_actions": "Description.Listener.DefaultActions", "load_balancer_arn": "Description.Listener.LoadBalancerArn", + "og_account_id": "metadata.IntegrationID", "port": "Description.Listener.Port", "protocol": "Description.Listener.Protocol", "ssl_policy": "Description.Listener.SslPolicy", @@ -31634,6 +32042,7 @@ var getElasticLoadBalancingV2ListenerFilters = map[string]string{ "certificates": "Description.Listener.Certificates", "default_actions": "Description.Listener.DefaultActions", "load_balancer_arn": "Description.Listener.LoadBalancerArn", + "og_account_id": "metadata.IntegrationID", "port": "Description.Listener.Port", "protocol": "Description.Listener.Protocol", "ssl_policy": "Description.Listener.SslPolicy", @@ -31700,6 +32109,7 @@ type ElasticLoadBalancingV2Rule struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ElasticLoadBalancingV2RuleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -31774,8 +32184,9 @@ func (p ElasticLoadBalancingV2RulePaginator) NextPage(ctx context.Context) ([]El } var listElasticLoadBalancingV2RuleFilters = map[string]string{ - "arn": "Description.Rule.RuleArn", - "title": "Description.Rule.RuleArn", + "arn": "Description.Rule.RuleArn", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Rule.RuleArn", } func ListElasticLoadBalancingV2Rule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -31839,8 +32250,9 @@ func ListElasticLoadBalancingV2Rule(ctx context.Context, d *plugin.QueryData, _ } var getElasticLoadBalancingV2RuleFilters = map[string]string{ - "arn": "description.Rule.RuleArn", - "title": "Description.Rule.RuleArn", + "arn": "description.Rule.RuleArn", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Rule.RuleArn", } func GetElasticLoadBalancingV2Rule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -31904,6 +32316,7 @@ type FSXFileSystem struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.FSXFileSystemDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -31990,6 +32403,7 @@ var listFSXFileSystemFilters = map[string]string{ "lifecycle": "Description.FileSystem.Lifecycle", "lustre_configuration": "Description.FileSystem.LustreConfiguration", "network_interface_ids": "Description.FileSystem.NetworkInterfaceIds", + "og_account_id": "metadata.IntegrationID", "ontap_configuration": "Description.FileSystem.OntapConfiguration", "open_zfs_configuration": "Description.FileSystem.OpenZFSConfiguration", "owner_id": "Description.FileSystem.OwnerId", @@ -32074,6 +32488,7 @@ var getFSXFileSystemFilters = map[string]string{ "lifecycle": "Description.FileSystem.Lifecycle", "lustre_configuration": "Description.FileSystem.LustreConfiguration", "network_interface_ids": "Description.FileSystem.NetworkInterfaceIds", + "og_account_id": "metadata.IntegrationID", "ontap_configuration": "Description.FileSystem.OntapConfiguration", "open_zfs_configuration": "Description.FileSystem.OpenZFSConfiguration", "owner_id": "Description.FileSystem.OwnerId", @@ -32146,6 +32561,7 @@ type FSXStorageVirtualMachine struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.FSXStorageVirtualMachineDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -32221,6 +32637,7 @@ func (p FSXStorageVirtualMachinePaginator) NextPage(ctx context.Context) ([]FSXS var listFSXStorageVirtualMachineFilters = map[string]string{ "name": "Description.StorageVirtualMachine.Name", + "og_account_id": "metadata.IntegrationID", "resource_arn": "Description.StorageVirtualMachine.ResourceARN", "storage_virtual_machine_id": "Description.StorageVirtualMachine.StorageVirtualMachineId", "title": "Description.StorageVirtualMachine.StorageVirtualMachineId", @@ -32288,6 +32705,7 @@ func ListFSXStorageVirtualMachine(ctx context.Context, d *plugin.QueryData, _ *p var getFSXStorageVirtualMachineFilters = map[string]string{ "name": "Description.StorageVirtualMachine.Name", + "og_account_id": "metadata.IntegrationID", "resource_arn": "Description.StorageVirtualMachine.ResourceARN", "storage_virtual_machine_id": "description.StorageVirtualMachine.StorageVirtualMachineId", "title": "Description.StorageVirtualMachine.StorageVirtualMachineId", @@ -32354,6 +32772,7 @@ type FSXTask struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.FSXTaskDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -32428,9 +32847,10 @@ func (p FSXTaskPaginator) NextPage(ctx context.Context) ([]FSXTask, error) { } var listFSXTaskFilters = map[string]string{ - "resource_arn": "Description.Task.ResourceARN", - "task_id": "Description.Task.TaskId", - "title": "Description.Task.TaskId", + "og_account_id": "metadata.IntegrationID", + "resource_arn": "Description.Task.ResourceARN", + "task_id": "Description.Task.TaskId", + "title": "Description.Task.TaskId", } func ListFSXTask(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -32494,9 +32914,10 @@ func ListFSXTask(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData } var getFSXTaskFilters = map[string]string{ - "resource_arn": "Description.Task.ResourceARN", - "task_id": "description.Task.TaskId", - "title": "Description.Task.TaskId", + "og_account_id": "metadata.IntegrationID", + "resource_arn": "Description.Task.ResourceARN", + "task_id": "description.Task.TaskId", + "title": "Description.Task.TaskId", } func GetFSXTask(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -32560,6 +32981,7 @@ type FSXVolume struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.FSXVolumeDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -32634,10 +33056,11 @@ func (p FSXVolumePaginator) NextPage(ctx context.Context) ([]FSXVolume, error) { } var listFSXVolumeFilters = map[string]string{ - "name": "Description.Volume.Name", - "resource_arn": "Description.Volume.ResourceARN", - "title": "Description.Volume.VolumeId", - "volume_id": "Description.Volume.VolumeId", + "name": "Description.Volume.Name", + "og_account_id": "metadata.IntegrationID", + "resource_arn": "Description.Volume.ResourceARN", + "title": "Description.Volume.VolumeId", + "volume_id": "Description.Volume.VolumeId", } func ListFSXVolume(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -32701,10 +33124,11 @@ func ListFSXVolume(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDa } var getFSXVolumeFilters = map[string]string{ - "name": "Description.Volume.Name", - "resource_arn": "Description.Volume.ResourceARN", - "title": "Description.Volume.VolumeId", - "volume_id": "description.Volume.VolumeId", + "name": "Description.Volume.Name", + "og_account_id": "metadata.IntegrationID", + "resource_arn": "Description.Volume.ResourceARN", + "title": "Description.Volume.VolumeId", + "volume_id": "description.Volume.VolumeId", } func GetFSXVolume(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -32768,6 +33192,7 @@ type FSXSnapshot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.FSXSnapshotDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -32842,10 +33267,11 @@ func (p FSXSnapshotPaginator) NextPage(ctx context.Context) ([]FSXSnapshot, erro } var listFSXSnapshotFilters = map[string]string{ - "name": "Description.Snapshot.Name", - "resource_arn": "Description.Snapshot.ResourceARN", - "snapshot_id": "Description.Snapshot.SnapshotId", - "title": "Description.Snapshot.SnapshotId", + "name": "Description.Snapshot.Name", + "og_account_id": "metadata.IntegrationID", + "resource_arn": "Description.Snapshot.ResourceARN", + "snapshot_id": "Description.Snapshot.SnapshotId", + "title": "Description.Snapshot.SnapshotId", } func ListFSXSnapshot(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -32909,10 +33335,11 @@ func ListFSXSnapshot(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydrate } var getFSXSnapshotFilters = map[string]string{ - "name": "Description.Snapshot.Name", - "resource_arn": "Description.Snapshot.ResourceARN", - "snapshot_id": "description.Snapshot.SnapshotId", - "title": "Description.Snapshot.SnapshotId", + "name": "Description.Snapshot.Name", + "og_account_id": "metadata.IntegrationID", + "resource_arn": "Description.Snapshot.ResourceARN", + "snapshot_id": "description.Snapshot.SnapshotId", + "title": "Description.Snapshot.SnapshotId", } func GetFSXSnapshot(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -32976,6 +33403,7 @@ type ApplicationAutoScalingTarget struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApplicationAutoScalingTargetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -33053,6 +33481,7 @@ var listApplicationAutoScalingTargetFilters = map[string]string{ "creation_time": "Description.ScalableTarget.CreationTime", "max_capacity": "Description.ScalableTarget.MaxCapacity", "min_capacity": "Description.ScalableTarget.MinCapacity", + "og_account_id": "metadata.IntegrationID", "resource_id": "description.ScalableTarget.ResourceId", "role_arn": "Description.ScalableTarget.RoleARN", "scalable_dimension": "description.ScalableTarget.ScalableDimension", @@ -33125,6 +33554,7 @@ var getApplicationAutoScalingTargetFilters = map[string]string{ "creation_time": "Description.ScalableTarget.CreationTime", "max_capacity": "Description.ScalableTarget.MaxCapacity", "min_capacity": "Description.ScalableTarget.MinCapacity", + "og_account_id": "metadata.IntegrationID", "resource_id": "description.ScalableTarget.ResourceId", "role_arn": "Description.ScalableTarget.RoleARN", "scalable_dimension": "Description.ScalableTarget.ScalableDimension", @@ -33194,6 +33624,7 @@ type ApplicationAutoScalingPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ApplicationAutoScalingPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -33270,6 +33701,7 @@ func (p ApplicationAutoScalingPolicyPaginator) NextPage(ctx context.Context) ([] var listApplicationAutoScalingPolicyFilters = map[string]string{ "alarms": "Description.ScalablePolicy.Alarms", "creation_time": "Description.ScalablePolicy.CreationTime", + "og_account_id": "metadata.IntegrationID", "policy_arn": "Description.ScalablePolicy.PolicyARN", "policy_name": "Description.ScalablePolicy.PolicyARN", "policy_type": "Description.ScalablePolicy.PolicyType", @@ -33344,6 +33776,7 @@ func ListApplicationAutoScalingPolicy(ctx context.Context, d *plugin.QueryData, var getApplicationAutoScalingPolicyFilters = map[string]string{ "alarms": "Description.ScalablePolicy.Alarms", "creation_time": "Description.ScalablePolicy.CreationTime", + "og_account_id": "metadata.IntegrationID", "policy_arn": "Description.ScalablePolicy.PolicyARN", "policy_name": "Description.ScalablePolicy.PolicyARN", "policy_type": "Description.ScalablePolicy.PolicyType", @@ -33416,6 +33849,7 @@ type AutoScalingGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AutoScalingGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -33513,6 +33947,7 @@ var listAutoScalingGroupFilters = map[string]string{ "mixed_instances_policy_launch_template_version": "Description.AutoScalingGroup.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.Version", "name": "Description.AutoScalingGroup.AutoScalingGroupName", "new_instances_protected_from_scale_in": "Description.AutoScalingGroup.NewInstancesProtectedFromScaleIn", + "og_account_id": "metadata.IntegrationID", "on_demand_allocation_strategy": "Description.AutoScalingGroup.MixedInstancesPolicy.InstancesDistribution.OnDemandAllocationStrategy", "on_demand_base_capacity": "Description.AutoScalingGroup.MixedInstancesPolicy.InstancesDistribution.OnDemandBaseCapacity", "on_demand_percentage_above_base_capacity": "Description.AutoScalingGroup.MixedInstancesPolicy.InstancesDistribution.OnDemandPercentageAboveBaseCapacity", @@ -33615,6 +34050,7 @@ var getAutoScalingGroupFilters = map[string]string{ "mixed_instances_policy_launch_template_version": "Description.AutoScalingGroup.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.Version", "name": "description.AutoScalingGroup.AutoScalingGroupName", "new_instances_protected_from_scale_in": "Description.AutoScalingGroup.NewInstancesProtectedFromScaleIn", + "og_account_id": "metadata.IntegrationID", "on_demand_allocation_strategy": "Description.AutoScalingGroup.MixedInstancesPolicy.InstancesDistribution.OnDemandAllocationStrategy", "on_demand_base_capacity": "Description.AutoScalingGroup.MixedInstancesPolicy.InstancesDistribution.OnDemandBaseCapacity", "on_demand_percentage_above_base_capacity": "Description.AutoScalingGroup.MixedInstancesPolicy.InstancesDistribution.OnDemandPercentageAboveBaseCapacity", @@ -33694,6 +34130,7 @@ type AutoScalingLaunchConfiguration struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AutoScalingLaunchConfigurationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -33785,6 +34222,7 @@ var listAutoScalingLaunchConfigurationFilters = map[string]string{ "metadata_options_http_tokens": "Description.LaunchConfiguration.MetadataOptions.HttpTokens", "metadata_options_put_response_hop_limit": "Description.LaunchConfiguration.MetadataOptions.HttpPutResponseHopLimit", "name": "Description.LaunchConfiguration.LaunchConfigurationName", + "og_account_id": "metadata.IntegrationID", "placement_tenancy": "Description.LaunchConfiguration.PlacementTenancy", "ramdisk_id": "Description.LaunchConfiguration.RamdiskId", "security_groups": "Description.LaunchConfiguration.SecurityGroups", @@ -33870,6 +34308,7 @@ var getAutoScalingLaunchConfigurationFilters = map[string]string{ "metadata_options_http_tokens": "Description.LaunchConfiguration.MetadataOptions.HttpTokens", "metadata_options_put_response_hop_limit": "Description.LaunchConfiguration.MetadataOptions.HttpPutResponseHopLimit", "name": "description.LaunchConfiguration.LaunchConfigurationName", + "og_account_id": "metadata.IntegrationID", "placement_tenancy": "Description.LaunchConfiguration.PlacementTenancy", "ramdisk_id": "Description.LaunchConfiguration.RamdiskId", "security_groups": "Description.LaunchConfiguration.SecurityGroups", @@ -33938,6 +34377,7 @@ type CertificateManagerCertificate struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CertificateManagerCertificateDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -34028,6 +34468,7 @@ var listCertificateManagerCertificateFilters = map[string]string{ "key_algorithm": "Description.Certificate.KeyAlgorithm", "not_after": "Description.Certificate.NotAfter", "not_before": "Description.Certificate.NotBefore", + "og_account_id": "metadata.IntegrationID", "renewal_eligibility": "Description.Certificate.RenewalEligibility", "revocation_reason": "Description.Certificate.RevocationReason", "revoked_at": "Description.Certificate.RevokedAt", @@ -34117,6 +34558,7 @@ var getCertificateManagerCertificateFilters = map[string]string{ "key_algorithm": "Description.Certificate.KeyAlgorithm", "not_after": "Description.Certificate.NotAfter", "not_before": "Description.Certificate.NotBefore", + "og_account_id": "metadata.IntegrationID", "renewal_eligibility": "Description.Certificate.RenewalEligibility", "revocation_reason": "Description.Certificate.RevocationReason", "revoked_at": "Description.Certificate.RevokedAt", @@ -34190,6 +34632,7 @@ type CloudTrailTrail struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudTrailTrailDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -34288,6 +34731,7 @@ var listCloudTrailTrailFilters = map[string]string{ "log_file_validation_enabled": "Description.Trail.LogFileValidationEnabled", "log_group_arn": "Description.Trail.CloudWatchLogsLogGroupArn", "name": "Description.Trail.Name", + "og_account_id": "metadata.IntegrationID", "s3_bucket_name": "Description.Trail.S3BucketName", "s3_key_prefix": "Description.Trail.S3KeyPrefix", "sns_topic_arn": "Description.Trail.SnsTopicARN", @@ -34382,6 +34826,7 @@ var getCloudTrailTrailFilters = map[string]string{ "log_file_validation_enabled": "Description.Trail.LogFileValidationEnabled", "log_group_arn": "Description.Trail.CloudWatchLogsLogGroupArn", "name": "description.Trail.Name", + "og_account_id": "metadata.IntegrationID", "s3_bucket_name": "Description.Trail.S3BucketName", "s3_key_prefix": "Description.Trail.S3KeyPrefix", "sns_topic_arn": "Description.Trail.SnsTopicARN", @@ -34452,6 +34897,7 @@ type CloudTrailChannel struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudTrailChannelDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -34531,6 +34977,7 @@ var listCloudTrailChannelFilters = map[string]string{ "arn": "Description.Channel.ChannelArn", "destinations": "Description.Channel.Destinations", "name": "Description.Channel.Name", + "og_account_id": "metadata.IntegrationID", "source": "Description.Channel.Source", "source_config": "Description.Channel.SourceConfig", "title": "Description.Channel.Name", @@ -34602,6 +35049,7 @@ var getCloudTrailChannelFilters = map[string]string{ "arn": "description.Channel.ChannelArn", "destinations": "Description.Channel.Destinations", "name": "Description.Channel.Name", + "og_account_id": "metadata.IntegrationID", "source": "Description.Channel.Source", "source_config": "Description.Channel.SourceConfig", "title": "Description.Channel.Name", @@ -34668,6 +35116,7 @@ type CloudTrailEventDataStore struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudTrailEventDataStoreDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -34747,6 +35196,7 @@ var listCloudTrailEventDataStoreFilters = map[string]string{ "created_timestamp": "Description.EventDataStore.CreatedTimestamp", "multi_region_enabled": "Description.EventDataStore.MultiRegionEnabled", "name": "Description.EventDataStore.Name", + "og_account_id": "metadata.IntegrationID", "organization_enabled": "Description.EventDataStore.OrganizationEnabled", "retention_period": "Description.EventDataStore.RetentionPeriod", "status": "Description.EventDataStore.Status", @@ -34821,6 +35271,7 @@ var getCloudTrailEventDataStoreFilters = map[string]string{ "created_timestamp": "Description.EventDataStore.CreatedTimestamp", "multi_region_enabled": "Description.EventDataStore.MultiRegionEnabled", "name": "Description.EventDataStore.Name", + "og_account_id": "metadata.IntegrationID", "organization_enabled": "Description.EventDataStore.OrganizationEnabled", "retention_period": "Description.EventDataStore.RetentionPeriod", "status": "Description.EventDataStore.Status", @@ -34890,6 +35341,7 @@ type CloudTrailImport struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudTrailImportDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -34971,6 +35423,7 @@ var listCloudTrailImportFilters = map[string]string{ "import_source": "Description.Import.ImportSource", "import_statistics": "Description.Import.ImportStatistics", "import_status": "description.Import.ImportStatus", + "og_account_id": "metadata.IntegrationID", "start_event_time": "Description.Import.StartEventTime", "title": "Description.Import.ImportId", "updated_timestamp": "Description.Import.UpdatedTimestamp", @@ -35044,6 +35497,7 @@ var getCloudTrailImportFilters = map[string]string{ "import_source": "Description.Import.ImportSource", "import_statistics": "Description.Import.ImportStatistics", "import_status": "Description.Import.ImportStatus", + "og_account_id": "metadata.IntegrationID", "start_event_time": "Description.Import.StartEventTime", "title": "Description.Import.ImportId", "updated_timestamp": "Description.Import.UpdatedTimestamp", @@ -35110,6 +35564,7 @@ type CloudTrailQuery struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudTrailQueryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -35193,6 +35648,7 @@ var listCloudTrailQueryFilters = map[string]string{ "events_matched": "Description.Query.QueryStatistics.EventsMatched", "events_scanned": "Description.Query.QueryStatistics.EventsScanned", "execution_time_in_millis": "Description.Query.QueryStatistics.ExecutionTimeInMillis", + "og_account_id": "metadata.IntegrationID", "query_id": "Description.Query.QueryId", "query_status": "description.Query.QueryStatus", "query_string": "Description.Query.QueryString", @@ -35269,6 +35725,7 @@ var getCloudTrailQueryFilters = map[string]string{ "events_matched": "Description.Query.QueryStatistics.EventsMatched", "events_scanned": "Description.Query.QueryStatistics.EventsScanned", "execution_time_in_millis": "Description.Query.QueryStatistics.ExecutionTimeInMillis", + "og_account_id": "metadata.IntegrationID", "query_id": "description.Query.QueryId", "query_status": "Description.Query.QueryStatus", "query_string": "Description.Query.QueryString", @@ -35336,6 +35793,7 @@ type CloudTrailTrailEvent struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudTrailTrailEventDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -35413,6 +35871,7 @@ var listCloudTrailTrailEventFilters = map[string]string{ "access_key_id": "UserIdentity.AccessKeyId", "log_group_name": "Description.LogGroupName", "log_stream_name": "description.TrailEvent.LogStreamName", + "og_account_id": "metadata.IntegrationID", "timestamp": "description.TrailEvent.Timestamp", "timestamp_ms": "Description.TrailEvent.Timestamp", "user_identifier": "UserIdentity.Arn", @@ -35484,6 +35943,7 @@ var getCloudTrailTrailEventFilters = map[string]string{ "access_key_id": "UserIdentity.AccessKeyId", "log_group_name": "Description.LogGroupName", "log_stream_name": "Description.TrailEvent.LogStreamName", + "og_account_id": "metadata.IntegrationID", "timestamp_ms": "Description.TrailEvent.Timestamp", "user_identifier": "UserIdentity.Arn", "user_type": "UserIdentity.Type", @@ -35551,6 +36011,7 @@ type IAMAccount struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMAccountDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -35631,6 +36092,7 @@ var listIAMAccountFilters = map[string]string{ "account_status": "Description.Account.Status", "arn": "Description.Account.Arn", "name": "Description.Account.Name", + "og_account_id": "metadata.IntegrationID", "organization_arn": "Description.Organization.Arn", "organization_available_policy_types": "Description.Organization.AvailablePolicyTypes", "organization_feature_set": "Description.Organization.FeatureSet", @@ -35708,6 +36170,7 @@ var getIAMAccountFilters = map[string]string{ "account_status": "Description.Account.Status", "arn": "Description.Account.Arn", "name": "Description.Account.Name", + "og_account_id": "metadata.IntegrationID", "organization_arn": "Description.Organization.Arn", "organization_available_policy_types": "Description.Organization.AvailablePolicyTypes", "organization_feature_set": "Description.Organization.FeatureSet", @@ -35779,6 +36242,7 @@ type IAMAccessAdvisor struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMAccessAdvisorDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -35856,6 +36320,7 @@ var listIAMAccessAdvisorFilters = map[string]string{ "last_authenticated": "Description.ServiceLastAccessed.LastAuthenticated", "last_authenticated_entity": "Description.ServiceLastAccessed.LastAuthenticatedEntity", "last_authenticated_region": "Description.ServiceLastAccessed.LastAuthenticatedRegion", + "og_account_id": "metadata.IntegrationID", "principal_arn": "Description.PrincipalArn", "service_name": "Description.ServiceLastAccessed.ServiceName", "service_namespace": "Description.ServiceLastAccessed.ServiceNamespace", @@ -35927,6 +36392,7 @@ var getIAMAccessAdvisorFilters = map[string]string{ "last_authenticated": "Description.ServiceLastAccessed.LastAuthenticated", "last_authenticated_entity": "Description.ServiceLastAccessed.LastAuthenticatedEntity", "last_authenticated_region": "Description.ServiceLastAccessed.LastAuthenticatedRegion", + "og_account_id": "metadata.IntegrationID", "principal_arn": "Description.PrincipalArn", "service_name": "Description.ServiceLastAccessed.ServiceName", "service_namespace": "Description.ServiceLastAccessed.ServiceNamespace", @@ -35995,6 +36461,7 @@ type IAMAccountSummary struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMAccountSummaryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -36085,6 +36552,7 @@ var listIAMAccountSummaryFilters = map[string]string{ "instance_profiles_quota": "Description.AccountSummary.InstanceProfilesQuota", "mfa_devices": "Description.AccountSummary.MFADevices", "mfa_devices_in_use": "Description.AccountSummary.MFADevicesInUse", + "og_account_id": "metadata.IntegrationID", "policies": "Description.AccountSummary.Policies", "policies_quota": "Description.AccountSummary.PoliciesQuota", "policy_size_quota": "Description.AccountSummary.PolicySizeQuota", @@ -36180,6 +36648,7 @@ var getIAMAccountSummaryFilters = map[string]string{ "instance_profiles_quota": "Description.AccountSummary.InstanceProfilesQuota", "mfa_devices": "Description.AccountSummary.MFADevices", "mfa_devices_in_use": "Description.AccountSummary.MFADevicesInUse", + "og_account_id": "metadata.IntegrationID", "policies": "Description.AccountSummary.Policies", "policies_quota": "Description.AccountSummary.PoliciesQuota", "policy_size_quota": "Description.AccountSummary.PolicySizeQuota", @@ -36259,6 +36728,7 @@ type IAMAccessKey struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMAccessKeyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -36338,6 +36808,7 @@ var listIAMAccessKeyFilters = map[string]string{ "access_key_last_used_region": "Description.AccessKeyLastUsed.Region", "access_key_last_used_service": "Description.AccessKeyLastUsed.ServiceName", "create_date": "Description.AccessKey.CreateDate", + "og_account_id": "metadata.IntegrationID", "status": "Description.AccessKey.Status", "title": "Description.AccessKey.AccessKeyId", "user_name": "Description.AccessKey.UserName", @@ -36409,6 +36880,7 @@ var getIAMAccessKeyFilters = map[string]string{ "access_key_last_used_region": "Description.AccessKeyLastUsed.Region", "access_key_last_used_service": "Description.AccessKeyLastUsed.ServiceName", "create_date": "Description.AccessKey.CreateDate", + "og_account_id": "metadata.IntegrationID", "status": "Description.AccessKey.Status", "title": "Description.AccessKey.AccessKeyId", "user_name": "Description.AccessKey.UserName", @@ -36475,6 +36947,7 @@ type IAMSSHPublicKey struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMSSHPublicKeyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -36549,6 +37022,7 @@ func (p IAMSSHPublicKeyPaginator) NextPage(ctx context.Context) ([]IAMSSHPublicK } var listIAMSSHPublicKeyFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "ssh_public_key_id": "Description.SSHPublicKeyKey.SSHPublicKeyId", "status": "Description.SSHPublicKeyKey.Status", "title": "Description.SSHPublicKeyKey.SSHPublicKeyId", @@ -36617,6 +37091,7 @@ func ListIAMSSHPublicKey(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd } var getIAMSSHPublicKeyFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "ssh_public_key_id": "Description.SSHPublicKeyKey.SSHPublicKeyId", "status": "Description.SSHPublicKeyKey.Status", "title": "Description.SSHPublicKeyKey.SSHPublicKeyId", @@ -36685,6 +37160,7 @@ type IAMAccountPasswordPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMAccountPasswordPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -36764,6 +37240,7 @@ var listIAMAccountPasswordPolicyFilters = map[string]string{ "hard_expiry": "Description.PasswordPolicy.HardExpiry", "max_password_age": "Description.PasswordPolicy.MaxPasswordAge", "minimum_password_length": "Description.PasswordPolicy.MinimumPasswordLength", + "og_account_id": "metadata.IntegrationID", "password_reuse_prevention": "Description.PasswordPolicy.PasswordReusePrevention", "require_lowercase_characters": "Description.PasswordPolicy.RequireLowercaseCharacters", "require_numbers": "Description.PasswordPolicy.RequireNumbers", @@ -36837,6 +37314,7 @@ var getIAMAccountPasswordPolicyFilters = map[string]string{ "hard_expiry": "Description.PasswordPolicy.HardExpiry", "max_password_age": "Description.PasswordPolicy.MaxPasswordAge", "minimum_password_length": "Description.PasswordPolicy.MinimumPasswordLength", + "og_account_id": "metadata.IntegrationID", "password_reuse_prevention": "Description.PasswordPolicy.PasswordReusePrevention", "require_lowercase_characters": "Description.PasswordPolicy.RequireLowercaseCharacters", "require_numbers": "Description.PasswordPolicy.RequireNumbers", @@ -36905,6 +37383,7 @@ type IAMUser struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMUserDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -36987,6 +37466,7 @@ var listIAMUserFilters = map[string]string{ "login_profile": "Description.LoginProfile", "mfa_devices": "Description.MFADevices", "name": "Description.User.UserName", + "og_account_id": "metadata.IntegrationID", "password_last_used": "Description.User.PasswordLastUsed", "path": "Description.User.Path", "permissions_boundary_arn": "Description.User.PermissionsBoundary.PermissionsBoundaryArn", @@ -37065,6 +37545,7 @@ var getIAMUserFilters = map[string]string{ "login_profile": "Description.LoginProfile", "mfa_devices": "Description.MFADevices", "name": "description.User.UserName", + "og_account_id": "metadata.IntegrationID", "password_last_used": "Description.User.PasswordLastUsed", "path": "Description.User.Path", "permissions_boundary_arn": "Description.User.PermissionsBoundary.PermissionsBoundaryArn", @@ -37135,6 +37616,7 @@ type IAMGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -37215,6 +37697,7 @@ var listIAMGroupFilters = map[string]string{ "group_id": "Description.Group.GroupId", "inline_policies": "Description.InlinePolicies", "name": "Description.Group.GroupName", + "og_account_id": "metadata.IntegrationID", "path": "Description.Group.Path", "title": "Description.Group.GroupName", "users": "Description.Users", @@ -37287,6 +37770,7 @@ var getIAMGroupFilters = map[string]string{ "group_id": "Description.Group.GroupId", "inline_policies": "Description.InlinePolicies", "name": "description.Group.GroupName", + "og_account_id": "metadata.IntegrationID", "path": "Description.Group.Path", "title": "Description.Group.GroupName", "users": "Description.Users", @@ -37353,6 +37837,7 @@ type IAMRole struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMRoleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -37435,6 +37920,7 @@ var listIAMRoleFilters = map[string]string{ "instance_profile_arns": "Description.InstanceProfileArns", "max_session_duration": "Description.Role.MaxSessionDuration", "name": "Description.Role.RoleName", + "og_account_id": "metadata.IntegrationID", "path": "Description.Role.Path", "permissions_boundary_arn": "Description.Role.PermissionsBoundary.PermissionsBoundaryArn", "permissions_boundary_type": "Description.Role.PermissionsBoundary.PermissionsBoundaryType", @@ -37514,6 +38000,7 @@ var getIAMRoleFilters = map[string]string{ "instance_profile_arns": "Description.InstanceProfileArns", "max_session_duration": "Description.Role.MaxSessionDuration", "name": "description.Role.RoleName", + "og_account_id": "metadata.IntegrationID", "path": "Description.Role.Path", "permissions_boundary_arn": "Description.Role.PermissionsBoundary.PermissionsBoundaryArn", "permissions_boundary_type": "Description.Role.PermissionsBoundary.PermissionsBoundaryType", @@ -37585,6 +38072,7 @@ type IAMServerCertificate struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMServerCertificateDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -37665,6 +38153,7 @@ var listIAMServerCertificateFilters = map[string]string{ "certificate_chain": "Description.ServerCertificate.CertificateChain", "expiration": "Description.ServerCertificate.ServerCertificateMetadata.Expiration", "name": "Description.ServerCertificate.ServerCertificateMetadata.ServerCertificateName", + "og_account_id": "metadata.IntegrationID", "path": "Description.ServerCertificate.ServerCertificateMetadata.Path", "server_certificate_id": "Description.ServerCertificate.ServerCertificateMetadata.ServerCertificateId", "tags": "Description.ServerCertificate.Tags", @@ -37740,6 +38229,7 @@ var getIAMServerCertificateFilters = map[string]string{ "certificate_chain": "Description.ServerCertificate.CertificateChain", "expiration": "Description.ServerCertificate.ServerCertificateMetadata.Expiration", "name": "description.ServerCertificate.ServerCertificateMetadata.ServerCertificateName", + "og_account_id": "metadata.IntegrationID", "path": "Description.ServerCertificate.ServerCertificateMetadata.Path", "server_certificate_id": "Description.ServerCertificate.ServerCertificateMetadata.ServerCertificateId", "tags": "Description.ServerCertificate.Tags", @@ -37809,6 +38299,7 @@ type IAMPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -37889,6 +38380,7 @@ var listIAMPolicyFilters = map[string]string{ "default_version_id": "Description.Policy.DefaultVersionId", "is_attachable": "Description.Policy.IsAttachable", "name": "Description.Policy.PolicyName", + "og_account_id": "metadata.IntegrationID", "path": "Description.Policy.Path", "permissions_boundary_usage_count": "Description.Policy.PermissionsBoundaryUsageCount", "policy_id": "Description.Policy.PolicyId", @@ -37964,6 +38456,7 @@ var getIAMPolicyFilters = map[string]string{ "default_version_id": "Description.Policy.DefaultVersionId", "is_attachable": "Description.Policy.IsAttachable", "name": "Description.Policy.PolicyName", + "og_account_id": "metadata.IntegrationID", "path": "Description.Policy.Path", "permissions_boundary_usage_count": "Description.Policy.PermissionsBoundaryUsageCount", "policy_id": "Description.Policy.PolicyId", @@ -38033,6 +38526,7 @@ type IAMCredentialReport struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMCredentialReportDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -38123,6 +38617,7 @@ var listIAMCredentialReportFilters = map[string]string{ "cert_2_last_rotated": "Description.CredentialReport.Cert2LastRotated", "generated_time": "Description.CredentialReport.GeneratedTime", "mfa_active": "Description.CredentialReport.MFAActive", + "og_account_id": "metadata.IntegrationID", "password_last_changed": "Description.CredentialReport.PasswordLastChanged", "password_last_used": "Description.CredentialReport.PasswordLastUsed", "password_next_rotation": "Description.CredentialReport.PasswordNextRotation", @@ -38208,6 +38703,7 @@ var getIAMCredentialReportFilters = map[string]string{ "cert_2_last_rotated": "Description.CredentialReport.Cert2LastRotated", "generated_time": "Description.CredentialReport.GeneratedTime", "mfa_active": "Description.CredentialReport.MFAActive", + "og_account_id": "metadata.IntegrationID", "password_last_changed": "Description.CredentialReport.PasswordLastChanged", "password_last_used": "Description.CredentialReport.PasswordLastUsed", "password_next_rotation": "Description.CredentialReport.PasswordNextRotation", @@ -38277,6 +38773,7 @@ type IAMVirtualMFADevice struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMVirtualMFADeviceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -38352,6 +38849,7 @@ func (p IAMVirtualMFADevicePaginator) NextPage(ctx context.Context) ([]IAMVirtua var listIAMVirtualMFADeviceFilters = map[string]string{ "enable_date": "Description.VirtualMFADevice.EnableDate", + "og_account_id": "metadata.IntegrationID", "serial_number": "Description.VirtualMFADevice.SerialNumber", "tags_src": "Description.Tags", "title": "Description.VirtualMFADevice.SerialNumber", @@ -38422,6 +38920,7 @@ func ListIAMVirtualMFADevice(ctx context.Context, d *plugin.QueryData, _ *plugin var getIAMVirtualMFADeviceFilters = map[string]string{ "enable_date": "Description.VirtualMFADevice.EnableDate", + "og_account_id": "metadata.IntegrationID", "serial_number": "Description.VirtualMFADevice.SerialNumber", "tags_src": "Description.Tags", "title": "Description.VirtualMFADevice.SerialNumber", @@ -38491,6 +38990,7 @@ type IAMPolicyAttachment struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMPolicyAttachmentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -38565,6 +39065,7 @@ func (p IAMPolicyAttachmentPaginator) NextPage(ctx context.Context) ([]IAMPolicy } var listIAMPolicyAttachmentFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "policy_arn": "Description.PolicyArn", "policy_groups": "Description.PolicyGroups", "policy_roles": "Description.PolicyRoles", @@ -38633,6 +39134,7 @@ func ListIAMPolicyAttachment(ctx context.Context, d *plugin.QueryData, _ *plugin var getIAMPolicyAttachmentFilters = map[string]string{ "is_attached": "description.IsAttached", + "og_account_id": "metadata.IntegrationID", "policy_arn": "Description.PolicyArn", "policy_groups": "Description.PolicyGroups", "policy_roles": "Description.PolicyRoles", @@ -38700,6 +39202,7 @@ type IAMSamlProvider struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMSamlProviderDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -38776,6 +39279,7 @@ func (p IAMSamlProviderPaginator) NextPage(ctx context.Context) ([]IAMSamlProvid var listIAMSamlProviderFilters = map[string]string{ "arn": "ARN", "create_date": "Description.SamlProvider.CreateDate", + "og_account_id": "metadata.IntegrationID", "saml_metadata_document": "Description.SamlProvider.SAMLMetadataDocument", "tags_src": "Description.SamlProvider.Tags", "valid_until": "Description.SamlProvider.ValidUntil", @@ -38844,6 +39348,7 @@ func ListIAMSamlProvider(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd var getIAMSamlProviderFilters = map[string]string{ "arn": "ARN", "create_date": "Description.SamlProvider.CreateDate", + "og_account_id": "metadata.IntegrationID", "saml_metadata_document": "Description.SamlProvider.SAMLMetadataDocument", "tags_src": "Description.SamlProvider.Tags", "valid_until": "Description.SamlProvider.ValidUntil", @@ -38910,6 +39415,7 @@ type IAMServiceSpecificCredential struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMServiceSpecificCredentialDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -38985,6 +39491,7 @@ func (p IAMServiceSpecificCredentialPaginator) NextPage(ctx context.Context) ([] var listIAMServiceSpecificCredentialFilters = map[string]string{ "create_date": "Description.ServiceSpecificCredential.CreateDate", + "og_account_id": "metadata.IntegrationID", "service_name": "description.ServiceSpecificCredential.ServiceName", "service_specific_credential_id": "Description.ServiceSpecificCredential.ServiceSpecificCredentialId", "service_user_name": "Description.ServiceSpecificCredential.ServiceUserName", @@ -39055,6 +39562,7 @@ func ListIAMServiceSpecificCredential(ctx context.Context, d *plugin.QueryData, var getIAMServiceSpecificCredentialFilters = map[string]string{ "create_date": "Description.ServiceSpecificCredential.CreateDate", + "og_account_id": "metadata.IntegrationID", "service_name": "Description.ServiceSpecificCredential.ServiceName", "service_specific_credential_id": "Description.ServiceSpecificCredential.ServiceSpecificCredentialId", "service_user_name": "Description.ServiceSpecificCredential.ServiceUserName", @@ -39124,6 +39632,7 @@ type IAMOpenIdConnectProvider struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IAMOpenIdConnectProviderDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -39200,6 +39709,7 @@ func (p IAMOpenIdConnectProviderPaginator) NextPage(ctx context.Context) ([]IAMO var listIAMOpenIdConnectProviderFilters = map[string]string{ "client_id_list": "Description.ClientIDList", "create_date": "Description.CreateDate", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.Tags", "thumbprint_list": "Description.ThumbprintList", "url": "Description.URL", @@ -39268,6 +39778,7 @@ func ListIAMOpenIdConnectProvider(ctx context.Context, d *plugin.QueryData, _ *p var getIAMOpenIdConnectProviderFilters = map[string]string{ "client_id_list": "Description.ClientIDList", "create_date": "Description.CreateDate", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.Tags", "thumbprint_list": "Description.ThumbprintList", "url": "Description.URL", @@ -39334,6 +39845,7 @@ type RDSDBCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -39450,6 +39962,7 @@ var listRDSDBClusterFilters = map[string]string{ "master_user_name": "Description.DBCluster.MasterUsername", "members": "Description.DBCluster.DBClusterMembers", "multi_az": "Description.DBCluster.MultiAZ", + "og_account_id": "metadata.IntegrationID", "option_group_memberships": "Description.DBCluster.DBClusterOptionGroupMemberships", "pending_maintenance_actions": "Description.PendingMaintenanceActions", "percent_progress": "Description.DBCluster.PercentProgress", @@ -39569,6 +40082,7 @@ var getRDSDBClusterFilters = map[string]string{ "master_user_name": "Description.DBCluster.MasterUsername", "members": "Description.DBCluster.DBClusterMembers", "multi_az": "Description.DBCluster.MultiAZ", + "og_account_id": "metadata.IntegrationID", "option_group_memberships": "Description.DBCluster.DBClusterOptionGroupMemberships", "pending_maintenance_actions": "Description.PendingMaintenanceActions", "percent_progress": "Description.DBCluster.PercentProgress", @@ -39646,6 +40160,7 @@ type RDSDBClusterParameterGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBClusterParameterGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -39724,6 +40239,7 @@ var listRDSDBClusterParameterGroupFilters = map[string]string{ "db_parameter_group_family": "Description.DBClusterParameterGroup.DBParameterGroupFamily", "description": "Description.DBClusterParameterGroup.Description", "name": "Description.DBClusterParameterGroup.DBClusterParameterGroupName", + "og_account_id": "metadata.IntegrationID", "parameters": "Description.Parameters", "tags_src": "Description.Tags", "title": "Description.DBClusterParameterGroup.DBClusterParameterGroupName", @@ -39794,6 +40310,7 @@ var getRDSDBClusterParameterGroupFilters = map[string]string{ "db_parameter_group_family": "Description.DBClusterParameterGroup.DBParameterGroupFamily", "description": "Description.DBClusterParameterGroup.Description", "name": "description.DBClusterParameterGroup.DBClusterParameterGroupName", + "og_account_id": "metadata.IntegrationID", "parameters": "Description.Parameters", "tags_src": "Description.Tags", "title": "Description.DBClusterParameterGroup.DBClusterParameterGroupName", @@ -39860,6 +40377,7 @@ type RDSOptionGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSOptionGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -39940,6 +40458,7 @@ var listRDSOptionGroupFilters = map[string]string{ "engine_name": "description.OptionGroup.EngineName", "major_engine_version": "description.OptionGroup.MajorEngineVersion", "name": "Description.OptionGroup.OptionGroupName", + "og_account_id": "metadata.IntegrationID", "options": "Description.OptionGroup.Options", "tags_src": "Description.Tags.TagList", "title": "Description.OptionGroup.OptionGroupName", @@ -40013,6 +40532,7 @@ var getRDSOptionGroupFilters = map[string]string{ "engine_name": "Description.OptionGroup.EngineName", "major_engine_version": "Description.OptionGroup.MajorEngineVersion", "name": "description.OptionGroup.OptionGroupName", + "og_account_id": "metadata.IntegrationID", "options": "Description.OptionGroup.Options", "tags_src": "Description.Tags.TagList", "title": "Description.OptionGroup.OptionGroupName", @@ -40080,6 +40600,7 @@ type RDSDBParameterGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBParameterGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -40158,6 +40679,7 @@ var listRDSDBParameterGroupFilters = map[string]string{ "db_parameter_group_family": "Description.DBParameterGroup.DBParameterGroupFamily", "description": "Description.DBParameterGroup.Description", "name": "Description.DBParameterGroup.DBParameterGroupName", + "og_account_id": "metadata.IntegrationID", "parameters": "Description.Parameters", "tags_src": "Description.Tags", "title": "Description.DBParameterGroup.DBParameterGroupName", @@ -40228,6 +40750,7 @@ var getRDSDBParameterGroupFilters = map[string]string{ "db_parameter_group_family": "Description.DBParameterGroup.DBParameterGroupFamily", "description": "Description.DBParameterGroup.Description", "name": "description.DBParameterGroup.DBParameterGroupName", + "og_account_id": "metadata.IntegrationID", "parameters": "Description.Parameters", "tags_src": "Description.Tags", "title": "Description.DBParameterGroup.DBParameterGroupName", @@ -40294,6 +40817,7 @@ type RDSDBProxy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBProxyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -40376,6 +40900,7 @@ var listRDSDBProxyFilters = map[string]string{ "endpoint": "Description.DBProxy.Endpoint", "engine_family": "Description.DBProxy.EngineFamily", "idle_client_timeout": "Description.DBProxy.IdleClientTimeout", + "og_account_id": "metadata.IntegrationID", "require_tls": "Description.DBProxy.RequireTLS", "role_arn": "Description.DBProxy.RoleArn", "status": "Description.DBProxy.Status", @@ -40456,6 +40981,7 @@ var getRDSDBProxyFilters = map[string]string{ "endpoint": "Description.DBProxy.Endpoint", "engine_family": "Description.DBProxy.EngineFamily", "idle_client_timeout": "Description.DBProxy.IdleClientTimeout", + "og_account_id": "metadata.IntegrationID", "require_tls": "Description.DBProxy.RequireTLS", "role_arn": "Description.DBProxy.RoleArn", "status": "Description.DBProxy.Status", @@ -40528,6 +41054,7 @@ type RDSDBSubnetGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBSubnetGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -40602,14 +41129,15 @@ func (p RDSDBSubnetGroupPaginator) NextPage(ctx context.Context) ([]RDSDBSubnetG } var listRDSDBSubnetGroupFilters = map[string]string{ - "arn": "Description.DBSubnetGroup.DBSubnetGroupArn", - "description": "Description.DBSubnetGroup.DBSubnetGroupDescription", - "name": "Description.DBSubnetGroup.DBSubnetGroupName", - "status": "Description.DBSubnetGroup.SubnetGroupStatus", - "subnets": "Description.DBSubnetGroup.Subnets", - "tags_src": "Description.Tags.TagList", - "title": "Description.DBSubnetGroup.DBSubnetGroupName", - "vpc_id": "Description.DBSubnetGroup.VpcId", + "arn": "Description.DBSubnetGroup.DBSubnetGroupArn", + "description": "Description.DBSubnetGroup.DBSubnetGroupDescription", + "name": "Description.DBSubnetGroup.DBSubnetGroupName", + "og_account_id": "metadata.IntegrationID", + "status": "Description.DBSubnetGroup.SubnetGroupStatus", + "subnets": "Description.DBSubnetGroup.Subnets", + "tags_src": "Description.Tags.TagList", + "title": "Description.DBSubnetGroup.DBSubnetGroupName", + "vpc_id": "Description.DBSubnetGroup.VpcId", } func ListRDSDBSubnetGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -40673,14 +41201,15 @@ func ListRDSDBSubnetGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy } var getRDSDBSubnetGroupFilters = map[string]string{ - "arn": "Description.DBSubnetGroup.DBSubnetGroupArn", - "description": "Description.DBSubnetGroup.DBSubnetGroupDescription", - "name": "description.DBSubnetGroup.DBSubnetGroupName", - "status": "Description.DBSubnetGroup.SubnetGroupStatus", - "subnets": "Description.DBSubnetGroup.Subnets", - "tags_src": "Description.Tags.TagList", - "title": "Description.DBSubnetGroup.DBSubnetGroupName", - "vpc_id": "Description.DBSubnetGroup.VpcId", + "arn": "Description.DBSubnetGroup.DBSubnetGroupArn", + "description": "Description.DBSubnetGroup.DBSubnetGroupDescription", + "name": "description.DBSubnetGroup.DBSubnetGroupName", + "og_account_id": "metadata.IntegrationID", + "status": "Description.DBSubnetGroup.SubnetGroupStatus", + "subnets": "Description.DBSubnetGroup.Subnets", + "tags_src": "Description.Tags.TagList", + "title": "Description.DBSubnetGroup.DBSubnetGroupName", + "vpc_id": "Description.DBSubnetGroup.VpcId", } func GetRDSDBSubnetGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -40744,6 +41273,7 @@ type RDSDBClusterSnapshot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBClusterSnapshotDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -40832,6 +41362,7 @@ var listRDSDBClusterSnapshotFilters = map[string]string{ "kms_key_id": "Description.DBClusterSnapshot.KmsKeyId", "license_model": "Description.DBClusterSnapshot.LicenseModel", "master_user_name": "Description.DBClusterSnapshot.MasterUsername", + "og_account_id": "metadata.IntegrationID", "percent_progress": "Description.DBClusterSnapshot.PercentProgress", "port": "Description.DBClusterSnapshot.Port", "source_db_cluster_snapshot_arn": "Description.DBClusterSnapshot.SourceDBClusterSnapshotArn", @@ -40918,6 +41449,7 @@ var getRDSDBClusterSnapshotFilters = map[string]string{ "kms_key_id": "Description.DBClusterSnapshot.KmsKeyId", "license_model": "Description.DBClusterSnapshot.LicenseModel", "master_user_name": "Description.DBClusterSnapshot.MasterUsername", + "og_account_id": "metadata.IntegrationID", "percent_progress": "Description.DBClusterSnapshot.PercentProgress", "port": "Description.DBClusterSnapshot.Port", "source_db_cluster_snapshot_arn": "Description.DBClusterSnapshot.SourceDBClusterSnapshotArn", @@ -40990,6 +41522,7 @@ type RDSDBEventSubscription struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBEventSubscriptionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -41069,6 +41602,7 @@ var listRDSDBEventSubscriptionFilters = map[string]string{ "customer_aws_id": "Description.EventSubscription.CustomerAwsId", "enabled": "Description.EventSubscription.Enabled", "event_categories_list": "Description.EventSubscription.EventCategoriesList", + "og_account_id": "metadata.IntegrationID", "sns_topic_arn": "Description.EventSubscription.SnsTopicArn", "source_ids_list": "Description.EventSubscription.SourceIdsList", "source_type": "Description.EventSubscription.SourceType", @@ -41142,6 +41676,7 @@ var getRDSDBEventSubscriptionFilters = map[string]string{ "customer_aws_id": "Description.EventSubscription.CustomerAwsId", "enabled": "Description.EventSubscription.Enabled", "event_categories_list": "Description.EventSubscription.EventCategoriesList", + "og_account_id": "metadata.IntegrationID", "sns_topic_arn": "Description.EventSubscription.SnsTopicArn", "source_ids_list": "Description.EventSubscription.SourceIdsList", "source_type": "Description.EventSubscription.SourceType", @@ -41210,6 +41745,7 @@ type RDSDBInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -41326,6 +41862,7 @@ var listRDSDBInstanceFilters = map[string]string{ "monitoring_role_arn": "Description.DBInstance.MonitoringRoleArn", "multi_az": "Description.DBInstance.MultiAZ", "nchar_character_set_name": "Description.DBInstance.NcharCharacterSetName", + "og_account_id": "metadata.IntegrationID", "option_group_memberships": "Description.DBInstance.OptionGroupMemberships", "pending_maintenance_actions": "Description.PendingMaintenance", "performance_insights_enabled": "Description.DBInstance.PerformanceInsightsEnabled", @@ -41460,6 +41997,7 @@ var getRDSDBInstanceFilters = map[string]string{ "monitoring_role_arn": "Description.DBInstance.MonitoringRoleArn", "multi_az": "Description.DBInstance.MultiAZ", "nchar_character_set_name": "Description.DBInstance.NcharCharacterSetName", + "og_account_id": "metadata.IntegrationID", "option_group_memberships": "Description.DBInstance.OptionGroupMemberships", "pending_maintenance_actions": "Description.PendingMaintenance", "performance_insights_enabled": "Description.DBInstance.PerformanceInsightsEnabled", @@ -41552,6 +42090,7 @@ type RDSDBSnapshot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBSnapshotDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -41643,6 +42182,7 @@ var listRDSDBSnapshotFilters = map[string]string{ "kms_key_id": "Description.DBSnapshot.KmsKeyId", "license_model": "Description.DBSnapshot.LicenseModel", "master_user_name": "Description.DBSnapshot.MasterUsername", + "og_account_id": "metadata.IntegrationID", "option_group_name": "Description.DBSnapshot.OptionGroupName", "percent_progress": "Description.DBSnapshot.PercentProgress", "port": "Description.DBSnapshot.Port", @@ -41737,6 +42277,7 @@ var getRDSDBSnapshotFilters = map[string]string{ "kms_key_id": "Description.DBSnapshot.KmsKeyId", "license_model": "Description.DBSnapshot.LicenseModel", "master_user_name": "Description.DBSnapshot.MasterUsername", + "og_account_id": "metadata.IntegrationID", "option_group_name": "Description.DBSnapshot.OptionGroupName", "percent_progress": "Description.DBSnapshot.PercentProgress", "port": "Description.DBSnapshot.Port", @@ -41814,6 +42355,7 @@ type RDSGlobalCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSGlobalClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -41890,6 +42432,7 @@ func (p RDSGlobalClusterPaginator) NextPage(ctx context.Context) ([]RDSGlobalClu var listRDSGlobalClusterFilters = map[string]string{ "global_cluster_arn": "Description.GlobalCluster.GlobalClusterArn", "global_cluster_identifier": "Description.GlobalCluster.GlobalClusterIdentifier", + "og_account_id": "metadata.IntegrationID", "title": "Description.GlobalCluster.GlobalClusterIdentifier", } @@ -41956,6 +42499,7 @@ func ListRDSGlobalCluster(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy var getRDSGlobalClusterFilters = map[string]string{ "global_cluster_arn": "Description.GlobalCluster.GlobalClusterArn", "global_cluster_identifier": "description.DBGlobalCluster.GlobalClusterIdentifier", + "og_account_id": "metadata.IntegrationID", "title": "Description.GlobalCluster.GlobalClusterIdentifier", } @@ -42020,6 +42564,7 @@ type RDSReservedDBInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSReservedDBInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -42103,6 +42648,7 @@ var listRDSReservedDBInstanceFilters = map[string]string{ "lease_id": "description.ReservedDBInstance.LeaseId", "multi_az": "description.ReservedDBInstance.MultiAZ", "offering_type": "description.ReservedDBInstance.OfferingType", + "og_account_id": "metadata.IntegrationID", "product_description": "Description.ReservedDBInstance.ProductDescription", "recurring_charges": "Description.ReservedDBInstance.RecurringCharges", "reserved_db_instance_id": "Description.ReservedDBInstance.ReservedDBInstanceId", @@ -42183,6 +42729,7 @@ var getRDSReservedDBInstanceFilters = map[string]string{ "lease_id": "Description.ReservedDBInstance.LeaseId", "multi_az": "Description.ReservedDBInstance.MultiAZ", "offering_type": "Description.ReservedDBInstance.OfferingType", + "og_account_id": "metadata.IntegrationID", "product_description": "Description.ReservedDBInstance.ProductDescription", "recurring_charges": "Description.ReservedDBInstance.RecurringCharges", "reserved_db_instance_id": "description.ReservedDBInstance.ReservedDBInstanceId", @@ -42254,6 +42801,7 @@ type RDSDBInstanceAutomatedBackup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBInstanceAutomatedBackupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -42346,6 +42894,7 @@ var listRDSDBInstanceAutomatedBackupFilters = map[string]string{ "kms_key_id": "Description.InstanceAutomatedBackup.KmsKeyId", "license_model": "Description.InstanceAutomatedBackup.LicenseModel", "master_username": "Description.InstanceAutomatedBackup.MasterUsername", + "og_account_id": "metadata.IntegrationID", "option_group_name": "Description.InstanceAutomatedBackup.OptionGroupName", "port": "Description.InstanceAutomatedBackup.Port", "restore_window": "Description.InstanceAutomatedBackup.RestoreWindow", @@ -42437,6 +42986,7 @@ var getRDSDBInstanceAutomatedBackupFilters = map[string]string{ "kms_key_id": "Description.InstanceAutomatedBackup.KmsKeyId", "license_model": "Description.InstanceAutomatedBackup.LicenseModel", "master_username": "Description.InstanceAutomatedBackup.MasterUsername", + "og_account_id": "metadata.IntegrationID", "option_group_name": "Description.InstanceAutomatedBackup.OptionGroupName", "port": "Description.InstanceAutomatedBackup.Port", "restore_window": "Description.InstanceAutomatedBackup.RestoreWindow", @@ -42509,6 +43059,7 @@ type RDSDBEngineVersion struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBEngineVersionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -42767,6 +43318,7 @@ type RDSDBRecommendation struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RDSDBRecommendationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -43007,6 +43559,7 @@ type RedshiftCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RedshiftClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -43120,6 +43673,7 @@ var listRedshiftClusterFilters = map[string]string{ "next_maintenance_window_start_time": "Description.Cluster.NextMaintenanceWindowStartTime", "node_type": "Description.Cluster.NodeType", "number_of_nodes": "Description.Cluster.NumberOfNodes", + "og_account_id": "metadata.IntegrationID", "pending_actions": "Description.Cluster.PendingActions", "pending_modified_values": "Description.Cluster.PendingModifiedValues", "preferred_maintenance_window": "Description.Cluster.PreferredMaintenanceWindow", @@ -43235,6 +43789,7 @@ var getRedshiftClusterFilters = map[string]string{ "next_maintenance_window_start_time": "Description.Cluster.NextMaintenanceWindowStartTime", "node_type": "Description.Cluster.NodeType", "number_of_nodes": "Description.Cluster.NumberOfNodes", + "og_account_id": "metadata.IntegrationID", "pending_actions": "Description.Cluster.PendingActions", "pending_modified_values": "Description.Cluster.PendingModifiedValues", "preferred_maintenance_window": "Description.Cluster.PreferredMaintenanceWindow", @@ -43311,6 +43866,7 @@ type RedshiftEventSubscription struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RedshiftEventSubscriptionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -43389,6 +43945,7 @@ var listRedshiftEventSubscriptionFilters = map[string]string{ "customer_aws_id": "Description.EventSubscription.CustomerAwsId", "enabled": "Description.EventSubscription.Enabled", "event_categories_list": "Description.EventSubscription.EventCategoriesList", + "og_account_id": "metadata.IntegrationID", "severity": "Description.EventSubscription.Severity", "sns_topic_arn": "Description.EventSubscription.SnsTopicArn", "source_ids_list": "Description.EventSubscription.SourceIdsList", @@ -43464,6 +44021,7 @@ var getRedshiftEventSubscriptionFilters = map[string]string{ "customer_aws_id": "Description.EventSubscription.CustomerAwsId", "enabled": "Description.EventSubscription.Enabled", "event_categories_list": "Description.EventSubscription.EventCategoriesList", + "og_account_id": "metadata.IntegrationID", "severity": "Description.EventSubscription.Severity", "sns_topic_arn": "Description.EventSubscription.SnsTopicArn", "source_ids_list": "Description.EventSubscription.SourceIdsList", @@ -43535,6 +44093,7 @@ type RedshiftServerlessWorkgroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RedshiftServerlessWorkgroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -43615,6 +44174,7 @@ var listRedshiftServerlessWorkgroupFilters = map[string]string{ "endpoint": "Description.Workgroup.Endpoint", "enhanced_vpc_routing": "Description.Workgroup.EnhancedVpcRouting", "namespace_name": "Description.Workgroup.NamespaceName", + "og_account_id": "metadata.IntegrationID", "publicly_accessible": "Description.Workgroup.PubliclyAccessible", "security_group_ids": "Description.Workgroup.SecurityGroupIds", "status": "Description.Workgroup.Status", @@ -43693,6 +44253,7 @@ var getRedshiftServerlessWorkgroupFilters = map[string]string{ "endpoint": "Description.Workgroup.Endpoint", "enhanced_vpc_routing": "Description.Workgroup.EnhancedVpcRouting", "namespace_name": "Description.Workgroup.NamespaceName", + "og_account_id": "metadata.IntegrationID", "publicly_accessible": "Description.Workgroup.PubliclyAccessible", "security_group_ids": "Description.Workgroup.SecurityGroupIds", "status": "Description.Workgroup.Status", @@ -43765,6 +44326,7 @@ type RedshiftClusterParameterGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RedshiftClusterParameterGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -43839,12 +44401,13 @@ func (p RedshiftClusterParameterGroupPaginator) NextPage(ctx context.Context) ([ } var listRedshiftClusterParameterGroupFilters = map[string]string{ - "description": "Description.ClusterParameterGroup.Description", - "family": "Description.ClusterParameterGroup.ParameterGroupFamily", - "name": "Description.ClusterParameterGroup.ParameterGroupName", - "parameters": "Description.Parameters", - "tags_src": "Description.ClusterParameterGroup.Tags", - "title": "Description.ClusterParameterGroup.ParameterGroupName", + "description": "Description.ClusterParameterGroup.Description", + "family": "Description.ClusterParameterGroup.ParameterGroupFamily", + "name": "Description.ClusterParameterGroup.ParameterGroupName", + "og_account_id": "metadata.IntegrationID", + "parameters": "Description.Parameters", + "tags_src": "Description.ClusterParameterGroup.Tags", + "title": "Description.ClusterParameterGroup.ParameterGroupName", } func ListRedshiftClusterParameterGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -43908,12 +44471,13 @@ func ListRedshiftClusterParameterGroup(ctx context.Context, d *plugin.QueryData, } var getRedshiftClusterParameterGroupFilters = map[string]string{ - "description": "Description.ClusterParameterGroup.Description", - "family": "Description.ClusterParameterGroup.ParameterGroupFamily", - "name": "description.ClusterParameterGroup.ParameterGroupName", - "parameters": "Description.Parameters", - "tags_src": "Description.ClusterParameterGroup.Tags", - "title": "Description.ClusterParameterGroup.ParameterGroupName", + "description": "Description.ClusterParameterGroup.Description", + "family": "Description.ClusterParameterGroup.ParameterGroupFamily", + "name": "description.ClusterParameterGroup.ParameterGroupName", + "og_account_id": "metadata.IntegrationID", + "parameters": "Description.Parameters", + "tags_src": "Description.ClusterParameterGroup.Tags", + "title": "Description.ClusterParameterGroup.ParameterGroupName", } func GetRedshiftClusterParameterGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -43977,6 +44541,7 @@ type RedshiftSnapshot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RedshiftSnapshotDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -44073,6 +44638,7 @@ var listRedshiftSnapshotFilters = map[string]string{ "master_username": "Description.Snapshot.MasterUsername", "node_type": "Description.Snapshot.NodeType", "number_of_nodes": "Description.Snapshot.NumberOfNodes", + "og_account_id": "metadata.IntegrationID", "owner_account": "Description.Snapshot.OwnerAccount", "port": "Description.Snapshot.Port", "restorable_node_types": "Description.Snapshot.RestorableNodeTypes", @@ -44171,6 +44737,7 @@ var getRedshiftSnapshotFilters = map[string]string{ "master_username": "Description.Snapshot.MasterUsername", "node_type": "Description.Snapshot.NodeType", "number_of_nodes": "Description.Snapshot.NumberOfNodes", + "og_account_id": "metadata.IntegrationID", "owner_account": "Description.Snapshot.OwnerAccount", "port": "Description.Snapshot.Port", "restorable_node_types": "Description.Snapshot.RestorableNodeTypes", @@ -44247,6 +44814,7 @@ type RedshiftServerlessNamespace struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RedshiftServerlessNamespaceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -44331,6 +44899,7 @@ var listRedshiftServerlessNamespaceFilters = map[string]string{ "namespace_arn": "Description.Namespace.NamespaceArn", "namespace_id": "Description.Namespace.NamespaceId", "namespace_name": "Description.Namespace.NamespaceName", + "og_account_id": "metadata.IntegrationID", "status": "Description.Namespace.Status", "tags_src": "Description.Tags", "title": "Description.Namespace.NamespaceName", @@ -44407,6 +44976,7 @@ var getRedshiftServerlessNamespaceFilters = map[string]string{ "namespace_arn": "Description.Namespace.NamespaceArn", "namespace_id": "Description.Namespace.NamespaceId", "namespace_name": "description.Namespace.NamespaceName", + "og_account_id": "metadata.IntegrationID", "status": "Description.Namespace.Status", "tags_src": "Description.Tags", "title": "Description.Namespace.NamespaceName", @@ -44473,6 +45043,7 @@ type RedshiftServerlessSnapshot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RedshiftServerlessSnapshotDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -44547,6 +45118,7 @@ func (p RedshiftServerlessSnapshotPaginator) NextPage(ctx context.Context) ([]Re } var listRedshiftServerlessSnapshotFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "snapshot_arn": "Description.Snapshot.SnapshotArn", "snapshot_name": "Description.Snapshot.SnapshotName", "title": "Description.Snapshot.SnapshotName", @@ -44613,6 +45185,7 @@ func ListRedshiftServerlessSnapshot(ctx context.Context, d *plugin.QueryData, _ } var getRedshiftServerlessSnapshotFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "snapshot_arn": "Description.Snapshot.SnapshotArn", "snapshot_name": "description.Snapshot.SnapshotName", "title": "Description.Snapshot.SnapshotName", @@ -44679,6 +45252,7 @@ type RedshiftSubnetGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RedshiftSubnetGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -44755,6 +45329,7 @@ func (p RedshiftSubnetGroupPaginator) NextPage(ctx context.Context) ([]RedshiftS var listRedshiftSubnetGroupFilters = map[string]string{ "cluster_subnet_group_name": "Description.ClusterSubnetGroup.ClusterSubnetGroupName", "description": "Description.ClusterSubnetGroup.Description", + "og_account_id": "metadata.IntegrationID", "subnet_group_status": "Description.ClusterSubnetGroup.SubnetGroupStatus", "subnets": "Description.ClusterSubnetGroup.Subnets", "tags_src": "Description.ClusterSubnetGroup.Tags", @@ -44825,6 +45400,7 @@ func ListRedshiftSubnetGroup(ctx context.Context, d *plugin.QueryData, _ *plugin var getRedshiftSubnetGroupFilters = map[string]string{ "cluster_subnet_group_name": "description.ClusterSubnetGroup.ClusterSubnetGroupName", "description": "Description.ClusterSubnetGroup.Description", + "og_account_id": "metadata.IntegrationID", "subnet_group_status": "Description.ClusterSubnetGroup.SubnetGroupStatus", "subnets": "Description.ClusterSubnetGroup.Subnets", "tags_src": "Description.ClusterSubnetGroup.Tags", @@ -44893,6 +45469,7 @@ type SNSTopic struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SNSTopicDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -44981,6 +45558,7 @@ var listSNSTopicFilters = map[string]string{ "lambda_failure_feedback_role_arn": "Description.Attributes.LambdaFailureFeedbackRoleArn", "lambda_success_feedback_role_arn": "Description.Attributes.LambdaSuccessFeedbackRoleArn", "lambda_success_feedback_sample_rate": "Description.Attributes.LambdaSuccessFeedbackSampleRate", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Attributes.Owner", "sqs_failure_feedback_role_arn": "Description.Attributes.SQSFailureFeedbackRoleArn", "sqs_success_feedback_role_arn": "Description.Attributes.SQSSuccessFeedbackRoleArn", @@ -45067,6 +45645,7 @@ var getSNSTopicFilters = map[string]string{ "lambda_failure_feedback_role_arn": "Description.Attributes.LambdaFailureFeedbackRoleArn", "lambda_success_feedback_role_arn": "Description.Attributes.LambdaSuccessFeedbackRoleArn", "lambda_success_feedback_sample_rate": "Description.Attributes.LambdaSuccessFeedbackSampleRate", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Attributes.Owner", "sqs_failure_feedback_role_arn": "Description.Attributes.SQSFailureFeedbackRoleArn", "sqs_success_feedback_role_arn": "Description.Attributes.SQSSuccessFeedbackRoleArn", @@ -45139,6 +45718,7 @@ type SNSSubscription struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SNSSubscriptionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -45215,6 +45795,7 @@ func (p SNSSubscriptionPaginator) NextPage(ctx context.Context) ([]SNSSubscripti var listSNSSubscriptionFilters = map[string]string{ "confirmation_was_authenticated": "Description.Attributes.ConfirmationWasAuthenticated", "endpoint": "Description.Subscription.Endpoint", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Subscription.Owner", "pending_confirmation": "Description.Attributes.PendingConfirmation", "protocol": "Description.Subscription.Protocol", @@ -45286,6 +45867,7 @@ func ListSNSSubscription(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd var getSNSSubscriptionFilters = map[string]string{ "confirmation_was_authenticated": "Description.Attributes.ConfirmationWasAuthenticated", "endpoint": "Description.Subscription.Endpoint", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Subscription.Owner", "pending_confirmation": "Description.Attributes.PendingConfirmation", "protocol": "Description.Subscription.Protocol", @@ -45355,6 +45937,7 @@ type SQSQueue struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SQSQueueDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -45437,6 +46020,7 @@ var listSQSQueueFilters = map[string]string{ "kms_master_key_id": "Description.Attributes.KmsMasterKeyId", "max_message_size": "Description.Attributes.MaximumMessageSize", "message_retention_seconds": "Description.Attributes.MessageRetentionPeriod", + "og_account_id": "metadata.IntegrationID", "queue_arn": "Description.Attributes.QueueArn", "queue_url": "Description.Attributes.QueueUrl", "receive_wait_time_seconds": "Description.Attributes.ReceiveMessageWaitTimeSeconds", @@ -45514,6 +46098,7 @@ var getSQSQueueFilters = map[string]string{ "kms_master_key_id": "Description.Attributes.KmsMasterKeyId", "max_message_size": "Description.Attributes.MaximumMessageSize", "message_retention_seconds": "Description.Attributes.MessageRetentionPeriod", + "og_account_id": "metadata.IntegrationID", "queue_arn": "Description.Attributes.QueueArn", "queue_url": "description.Attributes.QueueUrl", "receive_wait_time_seconds": "Description.Attributes.ReceiveMessageWaitTimeSeconds", @@ -45583,6 +46168,7 @@ type S3Bucket struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.S3BucketDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -45669,6 +46255,7 @@ var listS3BucketFilters = map[string]string{ "name": "Description.Bucket.Name", "object_lock_configuration": "Description.ObjectLockConfiguration", "object_ownership_controls": "Description.BucketOwnershipControls.OwnershipControls", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "region": "Description.Region", "replication": "Description.ReplicationConfiguration", @@ -45752,6 +46339,7 @@ var getS3BucketFilters = map[string]string{ "name": "description.Bucket.Name", "object_lock_configuration": "Description.ObjectLockConfiguration", "object_ownership_controls": "Description.BucketOwnershipControls.OwnershipControls", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "region": "Description.Region", "replication": "Description.ReplicationConfiguration", @@ -45823,6 +46411,7 @@ type S3AccountSetting struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.S3AccountSettingDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -45900,6 +46489,7 @@ var listS3AccountSettingFilters = map[string]string{ "block_public_acls": "Description.PublicAccessBlockConfiguration.BlockPublicAcls", "block_public_policy": "Description.PublicAccessBlockConfiguration.BlockPublicPolicy", "ignore_public_acls": "Description.PublicAccessBlockConfiguration.IgnorePublicAcls", + "og_account_id": "metadata.IntegrationID", "restrict_public_buckets": "Description.PublicAccessBlockConfiguration.RestrictPublicBuckets", } @@ -45967,6 +46557,7 @@ var getS3AccountSettingFilters = map[string]string{ "block_public_acls": "Description.PublicAccessBlockConfiguration.BlockPublicAcls", "block_public_policy": "Description.PublicAccessBlockConfiguration.BlockPublicPolicy", "ignore_public_acls": "Description.PublicAccessBlockConfiguration.IgnorePublicAcls", + "og_account_id": "metadata.IntegrationID", "restrict_public_buckets": "Description.PublicAccessBlockConfiguration.RestrictPublicBuckets", } @@ -46031,6 +46622,7 @@ type S3Object struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.S3ObjectDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -46133,6 +46725,7 @@ var listS3ObjectFilters = map[string]string{ "object_lock_mode": "Description.Object.ObjectLockMode", "object_lock_retain_until_date": "Description.Object.ObjectLockRetainUntilDate", "object_parts": "Description.ObjectAttributes.ObjectParts", + "og_account_id": "metadata.IntegrationID", "owner": "Description.ObjectSummary.Owner", "parts_count": "Description.Object.PartsCount", "replication_status": "escription.Object.ReplicationStatus", @@ -46241,6 +46834,7 @@ var getS3ObjectFilters = map[string]string{ "object_lock_mode": "Description.Object.ObjectLockMode", "object_lock_retain_until_date": "Description.Object.ObjectLockRetainUntilDate", "object_parts": "Description.ObjectAttributes.ObjectParts", + "og_account_id": "metadata.IntegrationID", "owner": "Description.ObjectSummary.Owner", "parts_count": "Description.Object.PartsCount", "replication_status": "escription.Object.ReplicationStatus", @@ -46321,6 +46915,7 @@ type S3BucketIntelligentTieringConfiguration struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.S3BucketIntelligentTieringConfigurationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -46395,12 +46990,13 @@ func (p S3BucketIntelligentTieringConfigurationPaginator) NextPage(ctx context.C } var listS3BucketIntelligentTieringConfigurationFilters = map[string]string{ - "bucket_name": "Description.BucketName", - "filter": "Description.IntelligentTieringConfiguration.Filter", - "id": "Description.IntelligentTieringConfiguration.Id", - "status": "Description.IntelligentTieringConfiguration.Status", - "tierings": "Description.IntelligentTieringConfiguration.Tierings", - "title": "Description.IntelligentTieringConfiguration.Id", + "bucket_name": "Description.BucketName", + "filter": "Description.IntelligentTieringConfiguration.Filter", + "id": "Description.IntelligentTieringConfiguration.Id", + "og_account_id": "metadata.IntegrationID", + "status": "Description.IntelligentTieringConfiguration.Status", + "tierings": "Description.IntelligentTieringConfiguration.Tierings", + "title": "Description.IntelligentTieringConfiguration.Id", } func ListS3BucketIntelligentTieringConfiguration(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -46464,12 +47060,13 @@ func ListS3BucketIntelligentTieringConfiguration(ctx context.Context, d *plugin. } var getS3BucketIntelligentTieringConfigurationFilters = map[string]string{ - "bucket_name": "Description.BucketName", - "filter": "Description.IntelligentTieringConfiguration.Filter", - "id": "Description.IntelligentTieringConfiguration.Id", - "status": "Description.IntelligentTieringConfiguration.Status", - "tierings": "Description.IntelligentTieringConfiguration.Tierings", - "title": "Description.IntelligentTieringConfiguration.Id", + "bucket_name": "Description.BucketName", + "filter": "Description.IntelligentTieringConfiguration.Filter", + "id": "Description.IntelligentTieringConfiguration.Id", + "og_account_id": "metadata.IntegrationID", + "status": "Description.IntelligentTieringConfiguration.Status", + "tierings": "Description.IntelligentTieringConfiguration.Tierings", + "title": "Description.IntelligentTieringConfiguration.Id", } func GetS3BucketIntelligentTieringConfiguration(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -46533,6 +47130,7 @@ type S3MultiRegionAccessPoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.S3MultiRegionAccessPointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -46610,6 +47208,7 @@ var listS3MultiRegionAccessPointFilters = map[string]string{ "alias": "Description.Report.Alias", "created_at": "Description.Report.CreatedAt", "name": "Description.Report.Name", + "og_account_id": "metadata.IntegrationID", "public_access_block": "Description.Report.PublicAccessBlock", "regions": "Description.Report.Regions", "status": "Description.Report.Status", @@ -46680,6 +47279,7 @@ var getS3MultiRegionAccessPointFilters = map[string]string{ "alias": "Description.Report.Alias", "created_at": "Description.Report.CreatedAt", "name": "Description.Report.Name", + "og_account_id": "metadata.IntegrationID", "public_access_block": "Description.Report.PublicAccessBlock", "regions": "Description.Report.Regions", "status": "Description.Report.Status", @@ -46747,6 +47347,7 @@ type SageMakerEndpointConfiguration struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SageMakerEndpointConfigurationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -46826,6 +47427,7 @@ var listSageMakerEndpointConfigurationFilters = map[string]string{ "data_capture_config": "Description.EndpointConfig.DataCaptureConfig", "kms_key_id": "Description.EndpointConfig.KmsKeyId", "name": "Description.EndpointConfig.EndpointConfigName", + "og_account_id": "metadata.IntegrationID", "production_variants": "Description.EndpointConfig.ProductionVariants", "tags_src": "Description.Tags", "title": "Description.EndpointConfig.EndpointConfigName", @@ -46897,6 +47499,7 @@ var getSageMakerEndpointConfigurationFilters = map[string]string{ "data_capture_config": "Description.EndpointConfig.DataCaptureConfig", "kms_key_id": "Description.EndpointConfig.KmsKeyId", "name": "description.EndpointConfig.EndpointConfigName", + "og_account_id": "metadata.IntegrationID", "production_variants": "Description.EndpointConfig.ProductionVariants", "tags_src": "Description.Tags", "title": "Description.EndpointConfig.EndpointConfigName", @@ -46963,6 +47566,7 @@ type SageMakerApp struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SageMakerAppDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -47045,6 +47649,7 @@ var listSageMakerAppFilters = map[string]string{ "last_health_check_timestamp": "Description.DescribeAppOutput.LastHealthCheckTimestamp", "last_user_activity_timestamp": "Description.DescribeAppOutput.LastUserActivityTimestamp", "name": "Description.AppDetails.AppName", + "og_account_id": "metadata.IntegrationID", "resource_spec": "Description.DescribeAppOutput.ResourceSpec", "status": "Description.AppDetails.Status", "title": "Description.AppDetails.AppName", @@ -47120,6 +47725,7 @@ var getSageMakerAppFilters = map[string]string{ "last_health_check_timestamp": "Description.DescribeAppOutput.LastHealthCheckTimestamp", "last_user_activity_timestamp": "Description.DescribeAppOutput.LastUserActivityTimestamp", "name": "description.DescribeAppOutput.AppName", + "og_account_id": "metadata.IntegrationID", "resource_spec": "Description.DescribeAppOutput.ResourceSpec", "status": "Description.AppDetails.Status", "title": "Description.AppDetails.AppName", @@ -47187,6 +47793,7 @@ type SageMakerDomain struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SageMakerDomainDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -47274,6 +47881,7 @@ var listSageMakerDomainFilters = map[string]string{ "kms_key_id": "Description.Domain.KmsKeyId", "last_modified_time": "Description.Domain.LastModifiedTime", "name": "Description.Domain.DomainName", + "og_account_id": "metadata.IntegrationID", "security_group_id_for_domain_boundary": "Description.Domain.SecurityGroupIdForDomainBoundary", "single_sign_on_managed_application_instance_id": "Description.Domain.SingleSignOnManagedApplicationInstanceId", "status": "Description.Domain.Status", @@ -47357,6 +47965,7 @@ var getSageMakerDomainFilters = map[string]string{ "kms_key_id": "Description.Domain.KmsKeyId", "last_modified_time": "Description.Domain.LastModifiedTime", "name": "Description.Domain.DomainName", + "og_account_id": "metadata.IntegrationID", "security_group_id_for_domain_boundary": "Description.Domain.SecurityGroupIdForDomainBoundary", "single_sign_on_managed_application_instance_id": "Description.Domain.SingleSignOnManagedApplicationInstanceId", "status": "Description.Domain.Status", @@ -47427,6 +48036,7 @@ type SageMakerNotebookInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SageMakerNotebookInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -47515,6 +48125,7 @@ var listSageMakerNotebookInstanceFilters = map[string]string{ "network_interface_id": "Description.NotebookInstance.NetworkInterfaceId", "notebook_instance_lifecycle_config_name": "Description.NotebookInstance.NotebookInstanceLifecycleConfigName", "notebook_instance_status": "Description.NotebookInstance.NotebookInstanceStatus", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.NotebookInstance.RoleArn", "root_access": "Description.NotebookInstance.RootAccess", "security_groups": "Description.NotebookInstance.SecurityGroups", @@ -47600,6 +48211,7 @@ var getSageMakerNotebookInstanceFilters = map[string]string{ "network_interface_id": "Description.NotebookInstance.NetworkInterfaceId", "notebook_instance_lifecycle_config_name": "Description.NotebookInstance.NotebookInstanceLifecycleConfigName", "notebook_instance_status": "Description.NotebookInstance.NotebookInstanceStatus", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.NotebookInstance.RoleArn", "root_access": "Description.NotebookInstance.RootAccess", "security_groups": "Description.NotebookInstance.SecurityGroups", @@ -47671,6 +48283,7 @@ type SageMakerModel struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SageMakerModelDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -47752,6 +48365,7 @@ var listSageMakerModelFilters = map[string]string{ "execution_role_arn": "Description.Model.ExecutionRoleArn", "inference_execution_config": "Description.Model.InferenceExecutionConfig", "name": "Description.Model.ModelName", + "og_account_id": "metadata.IntegrationID", "primary_container": "Description.Model.PrimaryContainer", "tags_src": "Description.Tags", "title": "Description.Model.ModelName", @@ -47826,6 +48440,7 @@ var getSageMakerModelFilters = map[string]string{ "execution_role_arn": "Description.Model.ExecutionRoleArn", "inference_execution_config": "Description.Model.InferenceExecutionConfig", "name": "description.Model.ModelName", + "og_account_id": "metadata.IntegrationID", "primary_container": "Description.Model.PrimaryContainer", "tags_src": "Description.Tags", "title": "Description.Model.ModelName", @@ -47893,6 +48508,7 @@ type SageMakerTrainingJob struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SageMakerTrainingJobDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -47989,6 +48605,7 @@ var listSageMakerTrainingJobFilters = map[string]string{ "last_modified_time": "description.TrainingJob.LastModifiedTime", "model_artifacts": "Description.TrainingJob.ModelArtifacts", "name": "Description.TrainingJob.TrainingJobName", + "og_account_id": "metadata.IntegrationID", "output_data_config": "Description.TrainingJob.OutputDataConfig", "profiler_config": "Description.TrainingJob.ProfilerConfig", "profiler_rule_configurations": "Description.TrainingJob.ProfilerRuleConfigurations", @@ -48093,6 +48710,7 @@ var getSageMakerTrainingJobFilters = map[string]string{ "last_modified_time": "Description.TrainingJob.LastModifiedTime", "model_artifacts": "Description.TrainingJob.ModelArtifacts", "name": "description.TrainingJob.Name", + "og_account_id": "metadata.IntegrationID", "output_data_config": "Description.TrainingJob.OutputDataConfig", "profiler_config": "Description.TrainingJob.ProfilerConfig", "profiler_rule_configurations": "Description.TrainingJob.ProfilerRuleConfigurations", @@ -48175,6 +48793,7 @@ type SecretsManagerSecret struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecretsManagerSecretDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -48258,6 +48877,7 @@ var listSecretsManagerSecretFilters = map[string]string{ "last_changed_date": "Description.Secret.LastChangedDate", "last_rotated_date": "Description.Secret.LastRotatedDate", "name": "Description.Secret.Name", + "og_account_id": "metadata.IntegrationID", "owning_service": "Description.Secret.OwningService", "policy": "Description.ResourcePolicy", "primary_region": "Description.Secret.PrimaryRegion", @@ -48340,6 +48960,7 @@ var getSecretsManagerSecretFilters = map[string]string{ "last_changed_date": "Description.Secret.LastChangedDate", "last_rotated_date": "Description.Secret.LastRotatedDate", "name": "Description.Secret.Name", + "og_account_id": "metadata.IntegrationID", "owning_service": "Description.Secret.OwningService", "policy": "Description.ResourcePolicy", "primary_region": "Description.Secret.PrimaryRegion", @@ -48413,6 +49034,7 @@ type SecurityHubHub struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubHubDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -48490,6 +49112,7 @@ var listSecurityHubHubFilters = map[string]string{ "administrator_account": "Description.AdministratorAccount", "auto_enable_controls": "Description.Hub.AutoEnableControls", "hub_arn": "Description.Hub.HubArn", + "og_account_id": "metadata.IntegrationID", "subscribed_at": "Description.Hub.SubscribedAt", "tags": "Description.Tags", } @@ -48558,6 +49181,7 @@ var getSecurityHubHubFilters = map[string]string{ "administrator_account": "Description.AdministratorAccount", "auto_enable_controls": "Description.Hub.AutoEnableControls", "hub_arn": "description.Hub.HubArn", + "og_account_id": "metadata.IntegrationID", "subscribed_at": "Description.Hub.SubscribedAt", "tags": "Description.Tags", } @@ -48623,6 +49247,7 @@ type SecurityHubActionTarget struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubActionTargetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -48697,10 +49322,11 @@ func (p SecurityHubActionTargetPaginator) NextPage(ctx context.Context) ([]Secur } var listSecurityHubActionTargetFilters = map[string]string{ - "arn": "Description.ActionTarget.ActionTargetArn", - "description": "Description.ActionTarget.Description", - "name": "Description.ActionTarget.Name", - "title": "Description.ActionTarget.Name", + "arn": "Description.ActionTarget.ActionTargetArn", + "description": "Description.ActionTarget.Description", + "name": "Description.ActionTarget.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.ActionTarget.Name", } func ListSecurityHubActionTarget(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -48764,10 +49390,11 @@ func ListSecurityHubActionTarget(ctx context.Context, d *plugin.QueryData, _ *pl } var getSecurityHubActionTargetFilters = map[string]string{ - "arn": "description.ActionTarget.ActionTargetArn", - "description": "Description.ActionTarget.Description", - "name": "Description.ActionTarget.Name", - "title": "Description.ActionTarget.Name", + "arn": "description.ActionTarget.ActionTargetArn", + "description": "Description.ActionTarget.Description", + "name": "Description.ActionTarget.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.ActionTarget.Name", } func GetSecurityHubActionTarget(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -48831,6 +49458,7 @@ type SecurityHubFinding struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubFindingDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -48923,6 +49551,7 @@ var listSecurityHubFindingFilters = map[string]string{ "network": "Description.Finding.Network", "network_path": "Description.Finding.NetworkPath", "note": "Description.Finding.Note", + "og_account_id": "metadata.IntegrationID", "patch_summary": "Description.Finding.PatchSummary", "process": "Description.Finding.Process", "product_arn": "description.Finding.ProductArn", @@ -49024,6 +49653,7 @@ var getSecurityHubFindingFilters = map[string]string{ "network": "Description.Finding.Network", "network_path": "Description.Finding.NetworkPath", "note": "Description.Finding.Note", + "og_account_id": "metadata.IntegrationID", "patch_summary": "Description.Finding.PatchSummary", "process": "Description.Finding.Process", "product_arn": "Description.Finding.ProductArn", @@ -49107,6 +49737,7 @@ type SecurityHubFindingAggregator struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubFindingAggregatorDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -49183,6 +49814,7 @@ func (p SecurityHubFindingAggregatorPaginator) NextPage(ctx context.Context) ([] var listSecurityHubFindingAggregatorFilters = map[string]string{ "arn": "Description.FindingAggregator.FindingAggregatorArn", "finding_aggregation_region": "Description.FindingAggregator.FindingAggregationRegion", + "og_account_id": "metadata.IntegrationID", "region_linking_mode": "Description.FindingAggregator.RegionLinkingMode", "regions": "Description.FindingAggregator.Regions", } @@ -49250,6 +49882,7 @@ func ListSecurityHubFindingAggregator(ctx context.Context, d *plugin.QueryData, var getSecurityHubFindingAggregatorFilters = map[string]string{ "arn": "description.FindingAggregator.FindingAggregatorArn", "finding_aggregation_region": "Description.FindingAggregator.FindingAggregationRegion", + "og_account_id": "metadata.IntegrationID", "region_linking_mode": "Description.FindingAggregator.RegionLinkingMode", "regions": "Description.FindingAggregator.Regions", } @@ -49315,6 +49948,7 @@ type SecurityHubInsight struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubInsightDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -49393,6 +50027,7 @@ var listSecurityHubInsightFilters = map[string]string{ "filters": "Description.Insight.Filters", "group_by_attribute": "Description.Insight.GroupByAttribute", "name": "Description.Insight.Name", + "og_account_id": "metadata.IntegrationID", "title": "Description.Insight.Name", } @@ -49461,6 +50096,7 @@ var getSecurityHubInsightFilters = map[string]string{ "filters": "Description.Insight.Filters", "group_by_attribute": "Description.Insight.GroupByAttribute", "name": "Description.Insight.Name", + "og_account_id": "metadata.IntegrationID", "title": "Description.Insight.Name", } @@ -49525,6 +50161,7 @@ type SecurityHubMember struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubMemberDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -49605,6 +50242,7 @@ var listSecurityHubMemberFilters = map[string]string{ "master_id": "Description.Member.MasterId", "member_account_id": "Description.Member.AccountId", "member_status": "Description.Member.MemberStatus", + "og_account_id": "metadata.IntegrationID", "title": "Description.Member.AccountId", "updated_at": "Description.Member.UpdatedAt", } @@ -49676,6 +50314,7 @@ var getSecurityHubMemberFilters = map[string]string{ "master_id": "Description.Member.MasterId", "member_account_id": "Description.Member.AccountId", "member_status": "Description.Member.MemberStatus", + "og_account_id": "metadata.IntegrationID", "title": "Description.Member.AccountId", "updated_at": "Description.Member.UpdatedAt", } @@ -49741,6 +50380,7 @@ type SecurityHubProduct struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubProductDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -49822,6 +50462,7 @@ var listSecurityHubProductFilters = map[string]string{ "integration_types": "Description.Product.IntegrationTypes", "marketplace_url": "Description.Product.MarketplaceUrl", "name": "Description.Product.ProductName", + "og_account_id": "metadata.IntegrationID", "product_arn": "Description.Product.ProductArn", "product_subscription_resource_policy": "Description.Product.ProductSubscriptionResourcePolicy", "title": "Description.Product.ProductName", @@ -49895,6 +50536,7 @@ var getSecurityHubProductFilters = map[string]string{ "integration_types": "Description.Product.IntegrationTypes", "marketplace_url": "Description.Product.MarketplaceUrl", "name": "Description.Product.ProductName", + "og_account_id": "metadata.IntegrationID", "product_arn": "description.Product.ProductArn", "product_subscription_resource_policy": "Description.Product.ProductSubscriptionResourcePolicy", "title": "Description.Product.ProductName", @@ -49961,6 +50603,7 @@ type SecurityHubStandardsControl struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubStandardsControlDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -50041,6 +50684,7 @@ var listSecurityHubStandardsControlFilters = map[string]string{ "control_status_updated_at": "Description.StandardsControl.ControlStatusUpdatedAt", "description": "Description.StandardsControl.Description", "disabled_reason": "Description.StandardsControl.DisabledReason", + "og_account_id": "metadata.IntegrationID", "related_requirements": "Description.StandardsControl.RelatedRequirements", "remediation_url": "Description.StandardsControl.RemediationUrl", "severity_rating": "Description.StandardsControl.SeverityRating", @@ -50114,6 +50758,7 @@ var getSecurityHubStandardsControlFilters = map[string]string{ "control_status_updated_at": "Description.StandardsControl.ControlStatusUpdatedAt", "description": "Description.StandardsControl.Description", "disabled_reason": "Description.StandardsControl.DisabledReason", + "og_account_id": "metadata.IntegrationID", "related_requirements": "Description.StandardsControl.RelatedRequirements", "remediation_url": "Description.StandardsControl.RemediationUrl", "severity_rating": "Description.StandardsControl.SeverityRating", @@ -50181,6 +50826,7 @@ type SecurityHubStandardsSubscription struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityHubStandardsSubscriptionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -50258,6 +50904,7 @@ var listSecurityHubStandardsSubscriptionFilters = map[string]string{ "description": "Description.Standard.Description", "enabled_by_default": "Description.Standard.EnabledByDefault", "name": "Description.Standard.Name", + "og_account_id": "metadata.IntegrationID", "standards_arn": "Description.Standard.StandardsArn", "standards_input": "Description.StandardsSubscription.StandardsInput", "standards_managed_by": "Description.Standard.StandardsManagedBy", @@ -50331,6 +50978,7 @@ var getSecurityHubStandardsSubscriptionFilters = map[string]string{ "description": "Description.Standard.Description", "enabled_by_default": "Description.Standard.EnabledByDefault", "name": "Description.Standard.Name", + "og_account_id": "metadata.IntegrationID", "standards_arn": "Description.Standard.StandardsArn", "standards_input": "Description.StandardsSubscription.StandardsInput", "standards_managed_by": "Description.Standard.StandardsManagedBy", @@ -50401,6 +51049,7 @@ type SSMManagedInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMManagedInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -50488,6 +51137,7 @@ var listSSMManagedInstanceFilters = map[string]string{ "last_ping_date_time": "Description.InstanceInformation.LastPingDateTime", "last_successful_association_execution_date": "Description.InstanceInformation.LastSuccessfulAssociationExecutionDate", "name": "Description.InstanceInformation.Name", + "og_account_id": "metadata.IntegrationID", "ping_status": "Description.InstanceInformation.PingStatus", "platform_name": "Description.InstanceInformation.PlatformName", "platform_type": "Description.InstanceInformation.PlatformType", @@ -50571,6 +51221,7 @@ var getSSMManagedInstanceFilters = map[string]string{ "last_ping_date_time": "Description.InstanceInformation.LastPingDateTime", "last_successful_association_execution_date": "Description.InstanceInformation.LastSuccessfulAssociationExecutionDate", "name": "Description.InstanceInformation.Name", + "og_account_id": "metadata.IntegrationID", "ping_status": "Description.InstanceInformation.PingStatus", "platform_name": "Description.InstanceInformation.PlatformName", "platform_type": "Description.InstanceInformation.PlatformType", @@ -50641,6 +51292,7 @@ type SSMAssociation struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMAssociationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -50731,6 +51383,7 @@ var listSSMAssociationFilters = map[string]string{ "last_update_association_date": "Description.Association.AssociationDescription.LastUpdateAssociationDate", "max_concurrency": "Description.Association.AssociationDescription.MaxConcurrency", "max_errors": "Description.Association.AssociationDescription.MaxErrors", + "og_account_id": "metadata.IntegrationID", "output_location": "Description.Association.AssociationDescription.OutputLocation", "overview": "Description.AssociationItem.Overview", "parameters": "Description.Association.AssociationDescription.Parameters", @@ -50819,6 +51472,7 @@ var getSSMAssociationFilters = map[string]string{ "last_update_association_date": "Description.Association.AssociationDescription.LastUpdateAssociationDate", "max_concurrency": "Description.Association.AssociationDescription.MaxConcurrency", "max_errors": "Description.Association.AssociationDescription.MaxErrors", + "og_account_id": "metadata.IntegrationID", "output_location": "Description.Association.AssociationDescription.OutputLocation", "overview": "Description.AssociationItem.Overview", "parameters": "Description.Association.AssociationDescription.Parameters", @@ -50891,6 +51545,7 @@ type SSMDocument struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMDocumentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -50981,6 +51636,7 @@ var listSSMDocumentFilters = map[string]string{ "hash_type": "Description.Document.Document.HashType", "latest_version": "Description.Document.Document.LatestVersion", "name": "Description.Document.Document.Name", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Document.Document.Owner", "owner_type": "description.DocumentIdentifier.Owner", "parameters": "Description.Document.Document.Parameters", @@ -51076,6 +51732,7 @@ var getSSMDocumentFilters = map[string]string{ "hash_type": "Description.Document.Document.HashType", "latest_version": "Description.Document.Document.LatestVersion", "name": "description.DocumentIdentifier.Name", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Document.Document.Owner", "parameters": "Description.Document.Document.Parameters", "pending_review_version": "Description.Document.Document.PendingReviewVersion", @@ -51154,6 +51811,7 @@ type SSMDocumentPermission struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMDocumentPermissionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -51230,6 +51888,7 @@ func (p SSMDocumentPermissionPaginator) NextPage(ctx context.Context) ([]SSMDocu var listSSMDocumentPermissionFilters = map[string]string{ "account_ids": "Description.Permissions.AccountIds", "document_name": "Description.Document.Document.Name", + "og_account_id": "metadata.IntegrationID", "shared_account_id": "Description.Permissions.AccountSharingInfoList.AccountId", "shared_document_version": "Description.Permissions.AccountSharingInfoList.SharedDocumentVersion", "title": "Description.Permissions.AccountSharingInfoList.SharedDocumentVersion", @@ -51298,6 +51957,7 @@ func ListSSMDocumentPermission(ctx context.Context, d *plugin.QueryData, _ *plug var getSSMDocumentPermissionFilters = map[string]string{ "account_ids": "Description.Permissions.AccountIds", "document_name": "Description.Document.Document.Name", + "og_account_id": "metadata.IntegrationID", "shared_account_id": "Description.Permissions.AccountSharingInfoList.AccountId", "shared_document_version": "Description.Permissions.AccountSharingInfoList.SharedDocumentVersion", "title": "Description.Permissions.AccountSharingInfoList.SharedDocumentVersion", @@ -51364,6 +52024,7 @@ type SSMInventory struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMInventoryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -51441,6 +52102,7 @@ var listSSMInventoryFilters = map[string]string{ "capture_time": "Description.CaptureTime", "content": "Description.Content", "id": "description.Id", + "og_account_id": "metadata.IntegrationID", "schema": "Description.Schemas", "schema_version": "Description.SchemaVersion", "title": "Description.Id", @@ -51511,6 +52173,7 @@ var getSSMInventoryFilters = map[string]string{ "capture_time": "Description.CaptureTime", "content": "Description.Content", "id": "Description.Id", + "og_account_id": "metadata.IntegrationID", "schema": "Description.Schemas", "schema_version": "Description.SchemaVersion", "title": "Description.Id", @@ -51578,6 +52241,7 @@ type SSMInventoryEntry struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMInventoryEntryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -51655,6 +52319,7 @@ var listSSMInventoryEntryFilters = map[string]string{ "capture_time": "Description.CaptureTime", "entries": "Description.Entries", "instance_id": "description.InstanceId", + "og_account_id": "metadata.IntegrationID", "schema_version": "Description.SchemaVersion", "title": "Description.InstanceId", "type_name": "description.TypeName", @@ -51724,6 +52389,7 @@ var getSSMInventoryEntryFilters = map[string]string{ "capture_time": "Description.CaptureTime", "entries": "Description.Entries", "instance_id": "Description.InstanceId", + "og_account_id": "metadata.IntegrationID", "schema_version": "Description.SchemaVersion", "title": "Description.InstanceId", "type_name": "Description.TypeName", @@ -51790,6 +52456,7 @@ type SSMMaintenanceWindow struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMMaintenanceWindowDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -51875,6 +52542,7 @@ var listSSMMaintenanceWindowFilters = map[string]string{ "modified_date": "Description.MaintenanceWindow.ModifiedDate", "name": "description.MaintenanceWindowIdentity.Name", "next_execution_time": "Description.MaintenanceWindow.NextExecutionTime", + "og_account_id": "metadata.IntegrationID", "schedule": "Description.MaintenanceWindow.Schedule", "schedule_offset": "Description.MaintenanceWindow.ScheduleOffset", "schedule_timezone": "Description.MaintenanceWindow.ScheduleTimezone", @@ -51958,6 +52626,7 @@ var getSSMMaintenanceWindowFilters = map[string]string{ "modified_date": "Description.MaintenanceWindow.ModifiedDate", "name": "Description.MaintenanceWindow.Name", "next_execution_time": "Description.MaintenanceWindow.NextExecutionTime", + "og_account_id": "metadata.IntegrationID", "schedule": "Description.MaintenanceWindow.Schedule", "schedule_offset": "Description.MaintenanceWindow.ScheduleOffset", "schedule_timezone": "Description.MaintenanceWindow.ScheduleTimezone", @@ -52030,6 +52699,7 @@ type SSMParameter struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMParameterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -52110,6 +52780,7 @@ var listSSMParameterFilters = map[string]string{ "last_modified_date": "Description.Parameter.LastModifiedDate", "last_modified_user": "Description.ParameterMetadata.LastModifiedUser", "name": "Description.Parameter.Name", + "og_account_id": "metadata.IntegrationID", "policies": "Description.ParameterMetadata.Policies", "selector": "Description.Parameter.Selector", "source_result": "Description.Parameter.SourceResult", @@ -52188,6 +52859,7 @@ var getSSMParameterFilters = map[string]string{ "last_modified_date": "Description.Parameter.LastModifiedDate", "last_modified_user": "Description.ParameterMetadata.LastModifiedUser", "name": "description.ParameterMetadata.Name", + "og_account_id": "metadata.IntegrationID", "policies": "Description.ParameterMetadata.Policies", "selector": "Description.Parameter.Selector", "source_result": "Description.Parameter.SourceResult", @@ -52260,6 +52932,7 @@ type SSMPatchBaseline struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMPatchBaselineDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -52344,6 +53017,7 @@ var listSSMPatchBaselineFilters = map[string]string{ "global_filters": "Description.PatchBaseline.GlobalFilters", "modified_date": "Description.PatchBaseline.ModifiedDate", "name": "description.ParameterMetadata.Type", + "og_account_id": "metadata.IntegrationID", "operating_system": "description.ParameterMetadata.KeyId", "patch_groups": "Description.PatchBaseline.PatchGroups", "rejected_patches": "Description.PatchBaseline.RejectedPatches", @@ -52425,6 +53099,7 @@ var getSSMPatchBaselineFilters = map[string]string{ "global_filters": "Description.PatchBaseline.GlobalFilters", "modified_date": "Description.PatchBaseline.ModifiedDate", "name": "Description.PatchBaselineIdentity.BaselineName", + "og_account_id": "metadata.IntegrationID", "operating_system": "Description.PatchBaseline.OperatingSystem", "patch_groups": "Description.PatchBaseline.PatchGroups", "rejected_patches": "Description.PatchBaseline.RejectedPatches", @@ -52495,6 +53170,7 @@ type SSMManagedInstanceCompliance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMManagedInstanceComplianceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -52574,6 +53250,7 @@ var listSSMManagedInstanceComplianceFilters = map[string]string{ "execution_summary": "Description.ComplianceItem.ExecutionSummary", "id": "Description.ComplianceItem.Id", "name": "Description.ComplianceItem.Title", + "og_account_id": "metadata.IntegrationID", "resource_id": "description.ComplianceItem.ResourceId", "resource_type": "Description.ComplianceItem.ResourceType", "severity": "Description.ComplianceItem.Severity", @@ -52646,6 +53323,7 @@ var getSSMManagedInstanceComplianceFilters = map[string]string{ "execution_summary": "Description.ComplianceItem.ExecutionSummary", "id": "Description.ComplianceItem.Id", "name": "Description.ComplianceItem.Title", + "og_account_id": "metadata.IntegrationID", "resource_id": "Description.ComplianceItem.ResourceId", "resource_type": "Description.ComplianceItem.ResourceType", "severity": "Description.ComplianceItem.Severity", @@ -52713,6 +53391,7 @@ type SSMManagedInstancePatchState struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSMManagedInstancePatchStateDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -52798,6 +53477,7 @@ var listSSMManagedInstancePatchStateFilters = map[string]string{ "last_no_reboot_install_operation_time": "Description.PatchState.LastNoRebootInstallOperationTime", "missing_count": "Description.PatchState.MissingCount", "not_applicable_count": "Description.PatchState.NotApplicableCount", + "og_account_id": "metadata.IntegrationID", "operation": "Description.PatchState.Operation", "operation_end_time": "Description.PatchState.OperationEndTime", "operation_start_time": "Description.PatchState.OperationStartTime", @@ -52883,6 +53563,7 @@ var getSSMManagedInstancePatchStateFilters = map[string]string{ "last_no_reboot_install_operation_time": "Description.PatchState.LastNoRebootInstallOperationTime", "missing_count": "Description.PatchState.MissingCount", "not_applicable_count": "Description.PatchState.NotApplicableCount", + "og_account_id": "metadata.IntegrationID", "operation": "Description.PatchState.Operation", "operation_end_time": "Description.PatchState.OperationEndTime", "operation_start_time": "Description.PatchState.OperationStartTime", @@ -52957,6 +53638,7 @@ type ECSTaskDefinition struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECSTaskDefinitionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -53040,6 +53722,7 @@ var listECSTaskDefinitionFilters = map[string]string{ "ipc_mode": "Description.TaskDefinition.IpcMode", "memory": "Description.TaskDefinition.Memory", "network_mode": "Description.TaskDefinition.NetworkMode", + "og_account_id": "metadata.IntegrationID", "pid_mode": "Description.TaskDefinition.PidMode", "placement_constraints": "Description.TaskDefinition.PlacementConstraints", "proxy_configuration": "Description.TaskDefinition.ProxyConfiguration", @@ -53125,6 +53808,7 @@ var getECSTaskDefinitionFilters = map[string]string{ "ipc_mode": "Description.TaskDefinition.IpcMode", "memory": "Description.TaskDefinition.Memory", "network_mode": "Description.TaskDefinition.NetworkMode", + "og_account_id": "metadata.IntegrationID", "pid_mode": "Description.TaskDefinition.PidMode", "placement_constraints": "Description.TaskDefinition.PlacementConstraints", "proxy_configuration": "Description.TaskDefinition.ProxyConfiguration", @@ -53201,6 +53885,7 @@ type ECSCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECSClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -53282,6 +53967,7 @@ var listECSClusterFilters = map[string]string{ "cluster_arn": "Description.Cluster.ClusterArn", "cluster_name": "Description.Cluster.ClusterName", "default_capacity_provider_strategy": "Description.Cluster.DefaultCapacityProviderStrategy", + "og_account_id": "metadata.IntegrationID", "pending_tasks_count": "Description.Cluster.PendingTasksCount", "registered_container_instances_count": "Description.Cluster.RegisteredContainerInstancesCount", "running_tasks_count": "Description.Cluster.RunningTasksCount", @@ -53360,6 +54046,7 @@ var getECSClusterFilters = map[string]string{ "cluster_arn": "description.Cluster.ClusterArn", "cluster_name": "Description.Cluster.ClusterName", "default_capacity_provider_strategy": "Description.Cluster.DefaultCapacityProviderStrategy", + "og_account_id": "metadata.IntegrationID", "pending_tasks_count": "Description.Cluster.PendingTasksCount", "registered_container_instances_count": "Description.Cluster.RegisteredContainerInstancesCount", "running_tasks_count": "Description.Cluster.RunningTasksCount", @@ -53431,6 +54118,7 @@ type ECSService struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECSServiceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -53521,6 +54209,7 @@ var listECSServiceFilters = map[string]string{ "launch_type": "Description.Service.LaunchType", "load_balancers": "Description.Service.LoadBalancers", "network_configuration": "Description.Service.NetworkConfiguration", + "og_account_id": "metadata.IntegrationID", "pending_count": "Description.Service.PendingCount", "placement_constraints": "Description.Service.PlacementConstraints", "placement_strategy": "Description.Service.PlacementStrategy", @@ -53616,6 +54305,7 @@ var getECSServiceFilters = map[string]string{ "launch_type": "Description.Service.LaunchType", "load_balancers": "Description.Service.LoadBalancers", "network_configuration": "Description.Service.NetworkConfiguration", + "og_account_id": "metadata.IntegrationID", "pending_count": "Description.Service.PendingCount", "placement_constraints": "Description.Service.PlacementConstraints", "placement_strategy": "Description.Service.PlacementStrategy", @@ -53695,6 +54385,7 @@ type ECSContainerInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECSContainerInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -53777,6 +54468,7 @@ var listECSContainerInstanceFilters = map[string]string{ "capacity_provider_name": "Description.ContainerInstance.CapacityProviderName", "cluster_arn": "Description.Cluster.ClusterArn", "ec2_instance_id": "Description.ContainerInstance.Ec2InstanceId", + "og_account_id": "metadata.IntegrationID", "pending_tasks_count": "Description.ContainerInstance.PendingTasksCount", "registered_at": "Description.ContainerInstance.RegisteredAt", "registered_resources": "Description.ContainerInstance.RegisteredResources", @@ -53858,6 +54550,7 @@ var getECSContainerInstanceFilters = map[string]string{ "capacity_provider_name": "Description.ContainerInstance.CapacityProviderName", "cluster_arn": "Description.Cluster.ClusterArn", "ec2_instance_id": "Description.ContainerInstance.Ec2InstanceId", + "og_account_id": "metadata.IntegrationID", "pending_tasks_count": "Description.ContainerInstance.PendingTasksCount", "registered_at": "Description.ContainerInstance.RegisteredAt", "registered_resources": "Description.ContainerInstance.RegisteredResources", @@ -53931,6 +54624,7 @@ type ECSTaskSet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECSTaskSetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -54005,9 +54699,10 @@ func (p ECSTaskSetPaginator) NextPage(ctx context.Context) ([]ECSTaskSet, error) } var listECSTaskSetFilters = map[string]string{ - "id": "Description.TaskSet.Id", - "task_set_arn": "Description.TaskSet.TaskSetArn", - "title": "Description.TaskSet.Id", + "id": "Description.TaskSet.Id", + "og_account_id": "metadata.IntegrationID", + "task_set_arn": "Description.TaskSet.TaskSetArn", + "title": "Description.TaskSet.Id", } func ListECSTaskSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -54071,9 +54766,10 @@ func ListECSTaskSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateD } var getECSTaskSetFilters = map[string]string{ - "id": "description.TaskSet.Id", - "task_set_arn": "Description.TaskSet.TaskSetArn", - "title": "Description.TaskSet.Id", + "id": "description.TaskSet.Id", + "og_account_id": "metadata.IntegrationID", + "task_set_arn": "Description.TaskSet.TaskSetArn", + "title": "Description.TaskSet.Id", } func GetECSTaskSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -54137,6 +54833,7 @@ type ECSTask struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECSTaskDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -54232,6 +54929,7 @@ var listECSTaskFilters = map[string]string{ "last_status": "Description.Task.LastStatus", "launch_type": "description.Task.LaunchType", "memory": "Description.Task.Memory", + "og_account_id": "metadata.IntegrationID", "overrides": "Description.Task.Overrides", "platform_version": "Description.Task.PlatformVersion", "protection": "Description.TaskProtection", @@ -54332,6 +55030,7 @@ var getECSTaskFilters = map[string]string{ "last_status": "Description.Task.LastStatus", "launch_type": "Description.Task.LaunchType", "memory": "Description.Task.Memory", + "og_account_id": "metadata.IntegrationID", "overrides": "Description.Task.Overrides", "platform_version": "Description.Task.PlatformVersion", "protection": "Description.TaskProtection", @@ -54410,6 +55109,7 @@ type EFSFileSystem struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EFSFileSystemDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -54493,6 +55193,7 @@ var listEFSFileSystemFilters = map[string]string{ "life_cycle_state": "Description.FileSystem.LifeCycleState", "name": "Description.FileSystem.Name", "number_of_mount_targets": "Description.FileSystem.NumberOfMountTargets", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.FileSystem.OwnerId", "performance_mode": "Description.FileSystem.PerformanceMode", "policy": "Description.Policy", @@ -54573,6 +55274,7 @@ var getEFSFileSystemFilters = map[string]string{ "life_cycle_state": "Description.FileSystem.LifeCycleState", "name": "Description.FileSystem.Name", "number_of_mount_targets": "Description.FileSystem.NumberOfMountTargets", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.FileSystem.OwnerId", "performance_mode": "Description.FileSystem.PerformanceMode", "policy": "Description.Policy", @@ -54643,6 +55345,7 @@ type EFSAccessPoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EFSAccessPointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -54723,6 +55426,7 @@ var listEFSAccessPointFilters = map[string]string{ "file_system_id": "description.AccessPoint.FileSystemId", "life_cycle_state": "Description.AccessPoint.LifeCycleState", "name": "Description.AccessPoint.Name", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.AccessPoint.OwnerId", "posix_user": "Description.AccessPoint.PosixUser", "root_directory": "Description.AccessPoint.RootDirectory", @@ -54796,6 +55500,7 @@ var getEFSAccessPointFilters = map[string]string{ "file_system_id": "Description.AccessPoint.FileSystemId", "life_cycle_state": "Description.AccessPoint.LifeCycleState", "name": "Description.AccessPoint.Name", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.AccessPoint.OwnerId", "posix_user": "Description.AccessPoint.PosixUser", "root_directory": "Description.AccessPoint.RootDirectory", @@ -54863,6 +55568,7 @@ type EFSMountTarget struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EFSMountTargetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -54944,6 +55650,7 @@ var listEFSMountTargetFilters = map[string]string{ "life_cycle_state": "Description.MountTarget.LifeCycleState", "mount_target_id": "Description.MountTarget.MountTargetId", "network_interface_id": "Description.MountTarget.NetworkInterfaceId", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.MountTarget.OwnerId", "security_groups": "Description.SecurityGroups", "subnet_id": "Description.MountTarget.SubnetId", @@ -55019,6 +55726,7 @@ var getEFSMountTargetFilters = map[string]string{ "life_cycle_state": "Description.MountTarget.LifeCycleState", "mount_target_id": "description.MountTarget.MountTargetId", "network_interface_id": "Description.MountTarget.NetworkInterfaceId", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.MountTarget.OwnerId", "security_groups": "Description.SecurityGroups", "subnet_id": "Description.MountTarget.SubnetId", @@ -55087,6 +55795,7 @@ type EKSCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EKSClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -55170,6 +55879,7 @@ var listEKSClusterFilters = map[string]string{ "kubernetes_network_config": "Description.Cluster.KubernetesNetworkConfig", "logging": "Description.Cluster.Logging", "name": "Description.Cluster.Name", + "og_account_id": "metadata.IntegrationID", "platform_version": "Description.Cluster.PlatformVersion", "resources_vpc_config": "Description.Cluster.ResourcesVpcConfig", "role_arn": "Description.Cluster.RoleArn", @@ -55249,6 +55959,7 @@ var getEKSClusterFilters = map[string]string{ "kubernetes_network_config": "Description.Cluster.KubernetesNetworkConfig", "logging": "Description.Cluster.Logging", "name": "description.Cluster.Name", + "og_account_id": "metadata.IntegrationID", "platform_version": "Description.Cluster.PlatformVersion", "resources_vpc_config": "Description.Cluster.ResourcesVpcConfig", "role_arn": "Description.Cluster.RoleArn", @@ -55319,6 +56030,7 @@ type EKSAddon struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EKSAddonDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -55400,6 +56112,7 @@ var listEKSAddonFilters = map[string]string{ "created_at": "Description.Addon.CreatedAt", "health_issues": "Description.Addon.Health.Issues", "modified_at": "Description.Addon.ModifiedAt", + "og_account_id": "metadata.IntegrationID", "service_account_role_arn": "Description.Addon.ServiceAccountRoleArn", "status": "Description.Addon.Status", "tags": "Description.Addon.Tags", @@ -55474,6 +56187,7 @@ var getEKSAddonFilters = map[string]string{ "created_at": "Description.Addon.CreatedAt", "health_issues": "Description.Addon.Health.Issues", "modified_at": "Description.Addon.ModifiedAt", + "og_account_id": "metadata.IntegrationID", "service_account_role_arn": "Description.Addon.ServiceAccountRoleArn", "status": "Description.Addon.Status", "tags": "Description.Addon.Tags", @@ -55541,6 +56255,7 @@ type EKSNodegroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EKSNodegroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -55628,6 +56343,7 @@ var listEKSNodegroupFilters = map[string]string{ "modified_at": "Description.Nodegroup.ModifiedAt", "node_role": "Description.Nodegroup.NodeRole", "nodegroup_name": "Description.Nodegroup.NodegroupName", + "og_account_id": "metadata.IntegrationID", "release_version": "Description.Nodegroup.ReleaseVersion", "remote_access": "Description.Nodegroup.RemoteAccess", "resources": "Description.Nodegroup.Resources", @@ -55715,6 +56431,7 @@ var getEKSNodegroupFilters = map[string]string{ "modified_at": "Description.Nodegroup.ModifiedAt", "node_role": "Description.Nodegroup.NodeRole", "nodegroup_name": "description.Nodegroup.NodegroupName", + "og_account_id": "metadata.IntegrationID", "release_version": "Description.Nodegroup.ReleaseVersion", "remote_access": "Description.Nodegroup.RemoteAccess", "resources": "Description.Nodegroup.Resources", @@ -55789,6 +56506,7 @@ type EKSAddonVersion struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EKSAddonVersionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -55868,6 +56586,7 @@ var listEKSAddonVersionFilters = map[string]string{ "addon_version": "Description.AddonVersion.AddonVersion", "architecture": "Description.AddonVersion.Architecture", "compatibilities": "Description.AddonVersion.Compatibilities", + "og_account_id": "metadata.IntegrationID", "title": "Description.AddonVersion.AddonVersion", "type": "Description.AddonType", } @@ -55938,6 +56657,7 @@ var getEKSAddonVersionFilters = map[string]string{ "addon_version": "Description.AddonVersion.AddonVersion", "architecture": "Description.AddonVersion.Architecture", "compatibilities": "Description.AddonVersion.Compatibilities", + "og_account_id": "metadata.IntegrationID", "title": "Description.AddonVersion.AddonVersion", "type": "Description.AddonType", } @@ -56003,6 +56723,7 @@ type EKSFargateProfile struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EKSFargateProfileDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -56081,6 +56802,7 @@ var listEKSFargateProfileFilters = map[string]string{ "created_at": "Description.FargateProfile.CreatedAt", "fargate_profile_arn": "Description.FargateProfile.FargateProfileArn", "fargate_profile_name": "Description.FargateProfile.FargateProfileName", + "og_account_id": "metadata.IntegrationID", "pod_execution_role_arn": "Description.FargateProfile.PodExecutionRoleArn", "selectors": "Description.FargateProfile.Selectors", "status": "Description.FargateProfile.Status", @@ -56154,6 +56876,7 @@ var getEKSFargateProfileFilters = map[string]string{ "created_at": "Description.FargateProfile.CreatedAt", "fargate_profile_arn": "Description.FargateProfile.FargateProfileArn", "fargate_profile_name": "description.Fargate.FargateProfileName", + "og_account_id": "metadata.IntegrationID", "pod_execution_role_arn": "Description.FargateProfile.PodExecutionRoleArn", "selectors": "Description.FargateProfile.Selectors", "status": "Description.FargateProfile.Status", @@ -56223,6 +56946,7 @@ type WAFv2WebACL struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFv2WebACLDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -56307,6 +57031,7 @@ var listWAFv2WebACLFilters = map[string]string{ "logging_configuration": "Description.LoggingConfiguration", "managed_by_firewall_manager": "Description.WebACL.ManagedByFirewallManager", "name": "Description.WebACL.Name", + "og_account_id": "metadata.IntegrationID", "post_process_firewall_manager_rule_groups": "Description.WebACL.PostProcessFirewallManagerRuleGroups", "pre_process_firewall_manager_rule_groups": "Description.WebACL.PreProcessFirewallManagerRuleGroups", "rules": "Description.WebACL.Rules", @@ -56386,6 +57111,7 @@ var getWAFv2WebACLFilters = map[string]string{ "logging_configuration": "Description.LoggingConfiguration", "managed_by_firewall_manager": "Description.WebACL.ManagedByFirewallManager", "name": "description.WebACL.Name", + "og_account_id": "metadata.IntegrationID", "post_process_firewall_manager_rule_groups": "Description.WebACL.PostProcessFirewallManagerRuleGroups", "pre_process_firewall_manager_rule_groups": "Description.WebACL.PreProcessFirewallManagerRuleGroups", "rules": "Description.WebACL.Rules", @@ -56456,6 +57182,7 @@ type WAFv2IPSet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFv2IPSetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -56538,6 +57265,7 @@ var listWAFv2IPSetFilters = map[string]string{ "ip_address_version": "Description.IPSet.IPAddressVersion", "lock_token": "Description.IPSetSummary.LockToken", "name": "Description.IPSet.Name", + "og_account_id": "metadata.IntegrationID", "partition": "Metadata.Partition", "tags_src": "Description.Tags", "title": "Description.IPSet.Name", @@ -56612,6 +57340,7 @@ var getWAFv2IPSetFilters = map[string]string{ "ip_address_version": "Description.IPSet.IPAddressVersion", "lock_token": "Description.IPSetSummary.LockToken", "name": "description.IPSetSummary.Name", + "og_account_id": "metadata.IntegrationID", "partition": "Metadata.Partition", "scope": "description.IPSetSummary.Scope", "tags_src": "Description.Tags", @@ -56679,6 +57408,7 @@ type WAFv2RegexPatternSet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFv2RegexPatternSetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -56753,15 +57483,16 @@ func (p WAFv2RegexPatternSetPaginator) NextPage(ctx context.Context) ([]WAFv2Reg } var listWAFv2RegexPatternSetFilters = map[string]string{ - "account_id": "Metadata.AccountID", - "arn": "Description.RegexPatternSet.ARN", - "description": "Description.RegexPatternSet.Description", - "id": "Description.RegexPatternSet.Id", - "lock_token": "Description.RegexPatternSetSummary.LockToken", - "name": "Description.RegexPatternSet.Name", - "partition": "Metadata.Partition", - "tags_src": "Description.Tags.TagInfoForResource.TagList", - "title": "Description.RegexPatternSet.Name", + "account_id": "Metadata.AccountID", + "arn": "Description.RegexPatternSet.ARN", + "description": "Description.RegexPatternSet.Description", + "id": "Description.RegexPatternSet.Id", + "lock_token": "Description.RegexPatternSetSummary.LockToken", + "name": "Description.RegexPatternSet.Name", + "og_account_id": "metadata.IntegrationID", + "partition": "Metadata.Partition", + "tags_src": "Description.Tags.TagInfoForResource.TagList", + "title": "Description.RegexPatternSet.Name", } func ListWAFv2RegexPatternSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -56825,16 +57556,17 @@ func ListWAFv2RegexPatternSet(ctx context.Context, d *plugin.QueryData, _ *plugi } var getWAFv2RegexPatternSetFilters = map[string]string{ - "account_id": "Metadata.AccountID", - "arn": "Description.RegexPatternSet.ARN", - "description": "Description.RegexPatternSet.Description", - "id": "description.IPSetSummary.Id", - "lock_token": "Description.RegexPatternSetSummary.LockToken", - "name": "description.IPSetSummary.Name", - "partition": "Metadata.Partition", - "scope": "description.IPSetSummary.Scope", - "tags_src": "Description.Tags.TagInfoForResource.TagList", - "title": "Description.RegexPatternSet.Name", + "account_id": "Metadata.AccountID", + "arn": "Description.RegexPatternSet.ARN", + "description": "Description.RegexPatternSet.Description", + "id": "description.IPSetSummary.Id", + "lock_token": "Description.RegexPatternSetSummary.LockToken", + "name": "description.IPSetSummary.Name", + "og_account_id": "metadata.IntegrationID", + "partition": "Metadata.Partition", + "scope": "description.IPSetSummary.Scope", + "tags_src": "Description.Tags.TagInfoForResource.TagList", + "title": "Description.RegexPatternSet.Name", } func GetWAFv2RegexPatternSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -56898,6 +57630,7 @@ type WAFv2RuleGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFv2RuleGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -56979,6 +57712,7 @@ var listWAFv2RuleGroupFilters = map[string]string{ "id": "Description.RuleGroup.Id", "lock_token": "Description.RuleGroupSummary.LockToken", "name": "Description.RuleGroup.Name", + "og_account_id": "metadata.IntegrationID", "partition": "Metadata.Partition", "rules": "Description.RuleGroup.Rules", "tags_src": "Description.Tags.TagInfoForResource.TagList", @@ -57054,6 +57788,7 @@ var getWAFv2RuleGroupFilters = map[string]string{ "id": "description.RuleGroup.Id", "lock_token": "Description.RuleGroupSummary.LockToken", "name": "description.RuleGroup.Name", + "og_account_id": "metadata.IntegrationID", "partition": "Metadata.Partition", "rules": "Description.RuleGroup.Rules", "scope": "description.Tags", @@ -57123,6 +57858,7 @@ type KMSKey struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KMSKeyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -57210,6 +57946,7 @@ var listKMSKeyFilters = map[string]string{ "key_rotation_enabled": "Description.KeyRotationEnabled", "key_state": "Description.Metadata.KeyState", "key_usage": "Description.Metadata.KeyUsage", + "og_account_id": "metadata.IntegrationID", "origin": "Description.Metadata.Origin", "tags": "Description.Tags", "tags_src": "Description.Tags", @@ -57291,6 +58028,7 @@ var getKMSKeyFilters = map[string]string{ "key_rotation_enabled": "Description.KeyRotationEnabled", "key_state": "Description.Metadata.KeyState", "key_usage": "Description.Metadata.KeyUsage", + "og_account_id": "metadata.IntegrationID", "origin": "Description.Metadata.Origin", "tags": "Description.Tags", "tags_src": "Description.Tags", @@ -57359,6 +58097,7 @@ type KMSKeyRotation struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KMSKeyRotationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -57569,6 +58308,7 @@ type KMSAlias struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KMSAliasDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -57647,6 +58387,7 @@ var listKMSAliasFilters = map[string]string{ "arn": "Description.Alias.AliasArn", "creation_date": "Description.Alias.CreationDate", "last_updated_date": "Description.Alias.LastUpdatedDate", + "og_account_id": "metadata.IntegrationID", "target_key_id": "Description.Alias.TargetKeyId", "title": "Description.Alias.AliasName", } @@ -57716,6 +58457,7 @@ var getKMSAliasFilters = map[string]string{ "arn": "Description.Alias.AliasArn", "creation_date": "Description.Alias.CreationDate", "last_updated_date": "Description.Alias.LastUpdatedDate", + "og_account_id": "metadata.IntegrationID", "target_key_id": "Description.Alias.TargetKeyId", "title": "Description.Alias.AliasName", } @@ -57781,6 +58523,7 @@ type LambdaFunction struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.LambdaFunctionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -57874,6 +58617,7 @@ var listLambdaFunctionFilters = map[string]string{ "master_arn": "Description.Function.Configuration.MasterArn", "memory_size": "Description.Function.Configuration.MemorySize", "name": "Description.Function.Configuration.FunctionName", + "og_account_id": "metadata.IntegrationID", "package_type": "Description.Function.Configuration.PackageType", "policy": "Description.Policy.Policy", "reserved_concurrent_executions": "Description.Function.Concurrency.ReservedConcurrentExecutions", @@ -57975,6 +58719,7 @@ var getLambdaFunctionFilters = map[string]string{ "master_arn": "Description.Function.Configuration.MasterArn", "memory_size": "Description.Function.Configuration.MemorySize", "name": "description.Function.Configuration.FunctionName", + "og_account_id": "metadata.IntegrationID", "package_type": "Description.Function.Configuration.PackageType", "policy": "Description.Policy.Policy", "reserved_concurrent_executions": "Description.Function.Concurrency.ReservedConcurrentExecutions", @@ -58057,6 +58802,7 @@ type LambdaFunctionVersion struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.LambdaFunctionVersionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -58152,6 +58898,7 @@ var listLambdaFunctionVersionFilters = map[string]string{ "logging_config": "Description.FunctionVersion.LoggingConfig", "master_arn": "Description.FunctionVersion.MasterArn", "memory_size": "Description.FunctionVersion.MemorySize", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "revision_id": "Description.Policy.RevisionId", "role": "Description.FunctionVersion.Role", @@ -58254,6 +59001,7 @@ var getLambdaFunctionVersionFilters = map[string]string{ "logging_config": "Description.FunctionVersion.LoggingConfig", "master_arn": "Description.FunctionVersion.MasterArn", "memory_size": "Description.FunctionVersion.MemorySize", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "revision_id": "Description.Policy.RevisionId", "role": "Description.FunctionVersion.Role", @@ -58335,6 +59083,7 @@ type LambdaAlias struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.LambdaAliasDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -58414,6 +59163,7 @@ var listLambdaAliasFilters = map[string]string{ "function_name": "description.FunctionName", "function_version": "description.Alias.FunctionVersion", "name": "Description.Alias.Name", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "revision_id": "Description.Alias.RevisionId", "title": "Description.Alias.Name", @@ -58486,6 +59236,7 @@ var getLambdaAliasFilters = map[string]string{ "function_name": "description.FunctionName", "function_version": "Description.Alias.FunctionVersion", "name": "description.Alias.Name", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "region": "description.Alias.AliasName", "revision_id": "Description.Alias.RevisionId", @@ -58554,6 +59305,7 @@ type LambdaLayer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.LambdaLayerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -58636,6 +59388,7 @@ var listLambdaLayerFilters = map[string]string{ "layer_name": "Description.Layer.LayerName", "layer_version_arn": "Description.Layer.LatestMatchingVersion.LayerVersionArn", "license_info": "Description.Layer.LatestMatchingVersion.LicenseInfo", + "og_account_id": "metadata.IntegrationID", "title": "Description.Layer.LayerName", "version": "Description.Layer.LatestMatchingVersion.Version", } @@ -58709,6 +59462,7 @@ var getLambdaLayerFilters = map[string]string{ "layer_name": "Description.Layer.LayerName", "layer_version_arn": "Description.Layer.LatestMatchingVersion.LayerVersionArn", "license_info": "Description.Layer.LatestMatchingVersion.LicenseInfo", + "og_account_id": "metadata.IntegrationID", "title": "Description.Layer.LayerName", "version": "Description.Layer.LatestMatchingVersion.Version", } @@ -58774,6 +59528,7 @@ type LambdaLayerVersion struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.LambdaLayerVersionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -58857,6 +59612,7 @@ var listLambdaLayerVersionFilters = map[string]string{ "layer_name": "description.LayerName", "layer_version_arn": "Description.LayerVersion.LayerVersionArn", "license_info": "Description.LayerVersion.LicenseInfo", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "revision_id": "Description.Policy.RevisionId", "title": "Description.LayerName", @@ -58933,6 +59689,7 @@ var getLambdaLayerVersionFilters = map[string]string{ "layer_name": "description.LayerName", "layer_version_arn": "Description.LayerVersion.LayerVersionArn", "license_info": "Description.LayerVersion.LicenseInfo", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "revision_id": "Description.Policy.RevisionId", "title": "Description.LayerName", @@ -59000,6 +59757,7 @@ type S3AccessPoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.S3AccessPointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -59083,6 +59841,7 @@ var listS3AccessPointFilters = map[string]string{ "ignore_public_acls": "Description.AccessPoint.PublicAccessBlockConfiguration.IgnorePublicAcls", "name": "Description.AccessPoint.Name", "network_origin": "Description.AccessPoint.NetworkOrigin", + "og_account_id": "metadata.IntegrationID", "restrict_public_buckets": "Description.AccessPoint.PublicAccessBlockConfiguration.RestrictPublicBuckets", "title": "Description.AccessPoint.Name", "vpc_id": "Description.AccessPoint.VpcConfiguration.VpcId", @@ -59158,6 +59917,7 @@ var getS3AccessPointFilters = map[string]string{ "ignore_public_acls": "Description.AccessPoint.PublicAccessBlockConfiguration.IgnorePublicAcls", "name": "description.AccessPoint.Name", "network_origin": "Description.AccessPoint.NetworkOrigin", + "og_account_id": "metadata.IntegrationID", "region": "metadata.region", "restrict_public_buckets": "Description.AccessPoint.PublicAccessBlockConfiguration.RestrictPublicBuckets", "title": "Description.AccessPoint.Name", @@ -59225,6 +59985,7 @@ type CostExplorerByAccountMonthly struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerByAccountMonthlyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -59300,6 +60061,7 @@ func (p CostExplorerByAccountMonthlyPaginator) NextPage(ctx context.Context) ([] var listCostExplorerByAccountMonthlyFilters = map[string]string{ "linked_account_id": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", } func ListCostExplorerByAccountMonthly(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -59364,6 +60126,7 @@ func ListCostExplorerByAccountMonthly(ctx context.Context, d *plugin.QueryData, var getCostExplorerByAccountMonthlyFilters = map[string]string{ "linked_account_id": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", } func GetCostExplorerByAccountMonthly(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -59427,6 +60190,7 @@ type CostExplorerByServiceMonthly struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerByServiceMonthlyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -59501,7 +60265,8 @@ func (p CostExplorerByServiceMonthlyPaginator) NextPage(ctx context.Context) ([] } var listCostExplorerByServiceMonthlyFilters = map[string]string{ - "service": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", + "service": "Description.Dimension1", } func ListCostExplorerByServiceMonthly(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -59565,7 +60330,8 @@ func ListCostExplorerByServiceMonthly(ctx context.Context, d *plugin.QueryData, } var getCostExplorerByServiceMonthlyFilters = map[string]string{ - "service": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", + "service": "Description.Dimension1", } func GetCostExplorerByServiceMonthly(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -59629,6 +60395,7 @@ type CostExplorerByRecordTypeMonthly struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerByRecordTypeMonthlyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -59704,6 +60471,7 @@ func (p CostExplorerByRecordTypeMonthlyPaginator) NextPage(ctx context.Context) var listCostExplorerByRecordTypeMonthlyFilters = map[string]string{ "linked_account_id": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", "record_type": "Description.Dimension2", } @@ -59769,6 +60537,7 @@ func ListCostExplorerByRecordTypeMonthly(ctx context.Context, d *plugin.QueryDat var getCostExplorerByRecordTypeMonthlyFilters = map[string]string{ "linked_account_id": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", "record_type": "Description.Dimension2", } @@ -59833,6 +60602,7 @@ type CostExplorerByServiceUsageTypeMonthly struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerByServiceUsageTypeMonthlyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -59907,8 +60677,9 @@ func (p CostExplorerByServiceUsageTypeMonthlyPaginator) NextPage(ctx context.Con } var listCostExplorerByServiceUsageTypeMonthlyFilters = map[string]string{ - "service": "Dimension1", - "usage_type": "Dimension2", + "og_account_id": "metadata.IntegrationID", + "service": "Dimension1", + "usage_type": "Dimension2", } func ListCostExplorerByServiceUsageTypeMonthly(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -59972,8 +60743,9 @@ func ListCostExplorerByServiceUsageTypeMonthly(ctx context.Context, d *plugin.Qu } var getCostExplorerByServiceUsageTypeMonthlyFilters = map[string]string{ - "service": "Dimension1", - "usage_type": "Dimension2", + "og_account_id": "metadata.IntegrationID", + "service": "Dimension1", + "usage_type": "Dimension2", } func GetCostExplorerByServiceUsageTypeMonthly(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -60037,6 +60809,7 @@ type CostExplorerForcastMonthly struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerForcastMonthlyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -60111,9 +60884,10 @@ func (p CostExplorerForcastMonthlyPaginator) NextPage(ctx context.Context) ([]Co } var listCostExplorerForcastMonthlyFilters = map[string]string{ - "mean_value": "Description.MeanValue", - "period_end": "Description.PeriodEnd", - "period_start": "Description.PeriodStart", + "mean_value": "Description.MeanValue", + "og_account_id": "metadata.IntegrationID", + "period_end": "Description.PeriodEnd", + "period_start": "Description.PeriodStart", } func ListCostExplorerForcastMonthly(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -60177,9 +60951,10 @@ func ListCostExplorerForcastMonthly(ctx context.Context, d *plugin.QueryData, _ } var getCostExplorerForcastMonthlyFilters = map[string]string{ - "mean_value": "Description.MeanValue", - "period_end": "Description.PeriodEnd", - "period_start": "Description.PeriodStart", + "mean_value": "Description.MeanValue", + "og_account_id": "metadata.IntegrationID", + "period_end": "Description.PeriodEnd", + "period_start": "Description.PeriodStart", } func GetCostExplorerForcastMonthly(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -60243,6 +61018,7 @@ type CostExplorerByAccountDaily struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerByAccountDailyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -60318,6 +61094,7 @@ func (p CostExplorerByAccountDailyPaginator) NextPage(ctx context.Context) ([]Co var listCostExplorerByAccountDailyFilters = map[string]string{ "linked_account_id": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", } func ListCostExplorerByAccountDaily(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -60382,6 +61159,7 @@ func ListCostExplorerByAccountDaily(ctx context.Context, d *plugin.QueryData, _ var getCostExplorerByAccountDailyFilters = map[string]string{ "linked_account_id": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", } func GetCostExplorerByAccountDaily(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -60445,6 +61223,7 @@ type CostExplorerByServiceDaily struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerByServiceDailyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -60519,8 +61298,9 @@ func (p CostExplorerByServiceDailyPaginator) NextPage(ctx context.Context) ([]Co } var listCostExplorerByServiceDailyFilters = map[string]string{ - "cost_source": "description.Dimension2", - "service": "description.Dimension1", + "cost_source": "description.Dimension2", + "og_account_id": "metadata.IntegrationID", + "service": "description.Dimension1", } func ListCostExplorerByServiceDaily(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -60584,8 +61364,9 @@ func ListCostExplorerByServiceDaily(ctx context.Context, d *plugin.QueryData, _ } var getCostExplorerByServiceDailyFilters = map[string]string{ - "cost_source": "Description.Dimension2", - "service": "Description.Dimension1", + "cost_source": "Description.Dimension2", + "og_account_id": "metadata.IntegrationID", + "service": "Description.Dimension1", } func GetCostExplorerByServiceDaily(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -60649,6 +61430,7 @@ type CostExplorerByRecordTypeDaily struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerByRecordTypeDailyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -60724,6 +61506,7 @@ func (p CostExplorerByRecordTypeDailyPaginator) NextPage(ctx context.Context) ([ var listCostExplorerByRecordTypeDailyFilters = map[string]string{ "linked_account_id": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", "record_type": "Description.Dimension2", } @@ -60789,6 +61572,7 @@ func ListCostExplorerByRecordTypeDaily(ctx context.Context, d *plugin.QueryData, var getCostExplorerByRecordTypeDailyFilters = map[string]string{ "linked_account_id": "Description.Dimension1", + "og_account_id": "metadata.IntegrationID", "record_type": "Description.Dimension2", } @@ -60853,6 +61637,7 @@ type CostExplorerByServiceUsageTypeDaily struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerByServiceUsageTypeDailyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -60927,8 +61712,9 @@ func (p CostExplorerByServiceUsageTypeDailyPaginator) NextPage(ctx context.Conte } var listCostExplorerByServiceUsageTypeDailyFilters = map[string]string{ - "service": "Dimension1", - "usage_type": "Dimension2", + "og_account_id": "metadata.IntegrationID", + "service": "Dimension1", + "usage_type": "Dimension2", } func ListCostExplorerByServiceUsageTypeDaily(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -60992,8 +61778,9 @@ func ListCostExplorerByServiceUsageTypeDaily(ctx context.Context, d *plugin.Quer } var getCostExplorerByServiceUsageTypeDailyFilters = map[string]string{ - "service": "Dimension1", - "usage_type": "Dimension2", + "og_account_id": "metadata.IntegrationID", + "service": "Dimension1", + "usage_type": "Dimension2", } func GetCostExplorerByServiceUsageTypeDaily(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -61057,6 +61844,7 @@ type CostExplorerForcastDaily struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CostExplorerForcastDailyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -61131,9 +61919,10 @@ func (p CostExplorerForcastDailyPaginator) NextPage(ctx context.Context) ([]Cost } var listCostExplorerForcastDailyFilters = map[string]string{ - "mean_value": "Description.MeanValue", - "period_end": "Description.PeriodEnd", - "period_start": "Description.PeriodStart", + "mean_value": "Description.MeanValue", + "og_account_id": "metadata.IntegrationID", + "period_end": "Description.PeriodEnd", + "period_start": "Description.PeriodStart", } func ListCostExplorerForcastDaily(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -61197,9 +61986,10 @@ func ListCostExplorerForcastDaily(ctx context.Context, d *plugin.QueryData, _ *p } var getCostExplorerForcastDailyFilters = map[string]string{ - "mean_value": "Description.MeanValue", - "period_end": "Description.PeriodEnd", - "period_start": "Description.PeriodStart", + "mean_value": "Description.MeanValue", + "og_account_id": "metadata.IntegrationID", + "period_end": "Description.PeriodEnd", + "period_start": "Description.PeriodStart", } func GetCostExplorerForcastDaily(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -61263,6 +62053,7 @@ type ECRRepository struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECRRepositoryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -61346,6 +62137,7 @@ var listECRRepositoryFilters = map[string]string{ "image_tag_mutability": "Description.Repository.ImageTagMutability", "last_evaluated_at": "Description.LifecyclePolicy.LastEvaluatedAt", "lifecycle_policy": "Description.LifecyclePolicy.LifecyclePolicyText", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy.PolicyText", "registry_id": "Description.Repository.RegistryId", "repository_name": "Description.Repository.RepositoryName", @@ -61425,6 +62217,7 @@ var getECRRepositoryFilters = map[string]string{ "image_tag_mutability": "Description.Repository.ImageTagMutability", "last_evaluated_at": "Description.LifecyclePolicy.LastEvaluatedAt", "lifecycle_policy": "Description.LifecyclePolicy.LifecyclePolicyText", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy.PolicyText", "registry_id": "Description.Repository.RegistryId", "repository_name": "description.Repository.RepositoryName", @@ -61495,6 +62288,7 @@ type ECRImage struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECRImageDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -61579,6 +62373,7 @@ var listECRImageFilters = map[string]string{ "image_tags": "Description.Image.ImageTags", "image_uri": "Description.ImageUri", "last_recorded_pull_time": "Description.Image.LastRecordedPullTime", + "og_account_id": "metadata.IntegrationID", "registry_id": "description.Image.RegistryId", "repository_name": "description.Image.RepositoryName", } @@ -61654,6 +62449,7 @@ var getECRImageFilters = map[string]string{ "image_tags": "Description.Image.ImageTags", "image_uri": "Description.ImageUri", "last_recorded_pull_time": "Description.Image.LastRecordedPullTime", + "og_account_id": "metadata.IntegrationID", "registry_id": "Description.Image.RegistryId", "repository_name": "Description.Image.RepositoryName", } @@ -61719,6 +62515,7 @@ type ECRPublicRepository struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECRPublicRepositoryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -61796,6 +62593,7 @@ var listECRPublicRepositoryFilters = map[string]string{ "arn": "Description.PublicRepository.RepositoryArn", "created_at": "Description.PublicRepository.CreatedAt", "image_details": "Description.ImageDetails", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy.PolicyText", "registry_id": "Description.PublicRepository.RegistryId", "repository_name": "Description.PublicRepository.RepositoryName", @@ -61868,6 +62666,7 @@ var getECRPublicRepositoryFilters = map[string]string{ "arn": "Description.PublicRepository.RepositoryArn", "created_at": "Description.PublicRepository.CreatedAt", "image_details": "Description.ImageDetails", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy.PolicyText", "registry_id": "Description.PublicRepository.RegistryId", "repository_name": "description.PublicRepository.RepositoryName", @@ -61937,6 +62736,7 @@ type ECRPublicRegistry struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECRPublicRegistryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -62011,9 +62811,10 @@ func (p ECRPublicRegistryPaginator) NextPage(ctx context.Context) ([]ECRPublicRe } var listECRPublicRegistryFilters = map[string]string{ - "registry_arn": "Description.PublicRegistry.RegistryArn", - "registry_id": "Description.PublicRegistry.RegistryId", - "title": "Description.PublicRegistry.RegistryId", + "og_account_id": "metadata.IntegrationID", + "registry_arn": "Description.PublicRegistry.RegistryArn", + "registry_id": "Description.PublicRegistry.RegistryId", + "title": "Description.PublicRegistry.RegistryId", } func ListECRPublicRegistry(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -62077,9 +62878,10 @@ func ListECRPublicRegistry(ctx context.Context, d *plugin.QueryData, _ *plugin.H } var getECRPublicRegistryFilters = map[string]string{ - "registry_arn": "Description.PublicRegistry.RegistryArn", - "registry_id": "description.PublicRegistry.RegistryId", - "title": "Description.PublicRegistry.RegistryId", + "og_account_id": "metadata.IntegrationID", + "registry_arn": "Description.PublicRegistry.RegistryArn", + "registry_id": "description.PublicRegistry.RegistryId", + "title": "Description.PublicRegistry.RegistryId", } func GetECRPublicRegistry(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -62143,6 +62945,7 @@ type ECRRegistry struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECRRegistryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -62217,9 +63020,10 @@ func (p ECRRegistryPaginator) NextPage(ctx context.Context) ([]ECRRegistry, erro } var listECRRegistryFilters = map[string]string{ - "registry_id": "Description.RegistryId", - "rules": "Description.ReplicationRules", - "title": "Description.RegistryId", + "og_account_id": "metadata.IntegrationID", + "registry_id": "Description.RegistryId", + "rules": "Description.ReplicationRules", + "title": "Description.RegistryId", } func ListECRRegistry(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -62283,9 +63087,10 @@ func ListECRRegistry(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydrate } var getECRRegistryFilters = map[string]string{ - "registry_id": "description.Registry.RegistryId", - "rules": "Description.ReplicationRules", - "title": "Description.RegistryId", + "og_account_id": "metadata.IntegrationID", + "registry_id": "description.Registry.RegistryId", + "rules": "Description.ReplicationRules", + "title": "Description.RegistryId", } func GetECRRegistry(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -62349,6 +63154,7 @@ type ECRRegistryScanningConfiguration struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ECRRegistryScanningConfigurationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -62551,6 +63357,7 @@ type EventBridgeBus struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EventBridgeBusDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -62625,11 +63432,12 @@ func (p EventBridgeBusPaginator) NextPage(ctx context.Context) ([]EventBridgeBus } var listEventBridgeBusFilters = map[string]string{ - "arn": "Description.Bus.Arn", - "name": "Description.Bus.Name", - "policy": "Description.Bus.Policy", - "tags_src": "Description.Tags", - "title": "Description.Bus.Name", + "arn": "Description.Bus.Arn", + "name": "Description.Bus.Name", + "og_account_id": "metadata.IntegrationID", + "policy": "Description.Bus.Policy", + "tags_src": "Description.Tags", + "title": "Description.Bus.Name", } func ListEventBridgeBus(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -62693,11 +63501,12 @@ func ListEventBridgeBus(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr } var getEventBridgeBusFilters = map[string]string{ - "arn": "description.Bus.Arn", - "name": "Description.Bus.Name", - "policy": "Description.Bus.Policy", - "tags_src": "Description.Tags", - "title": "Description.Bus.Name", + "arn": "description.Bus.Arn", + "name": "Description.Bus.Name", + "og_account_id": "metadata.IntegrationID", + "policy": "Description.Bus.Policy", + "tags_src": "Description.Tags", + "title": "Description.Bus.Name", } func GetEventBridgeBus(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -62761,6 +63570,7 @@ type EventBridgeRule struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.EventBridgeRuleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -62843,6 +63653,7 @@ var listEventBridgeRuleFilters = map[string]string{ "managed_by": "Description.Rule.ManagedBy", "name": "Description.Rule.Name", "name_prefix": "description.Rule.Name", + "og_account_id": "metadata.IntegrationID", "state": "Description.Rule.State", "tags_src": "Description.Tags", "targets": "Description.Targets", @@ -62918,6 +63729,7 @@ var getEventBridgeRuleFilters = map[string]string{ "managed_by": "Description.Rule.ManagedBy", "name": "description.Rule.Name", "name_prefix": "Description.Rule.Name", + "og_account_id": "metadata.IntegrationID", "state": "Description.Rule.State", "tags_src": "Description.Tags", "targets": "Description.Targets", @@ -62985,6 +63797,7 @@ type AppStreamApplication struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AppStreamApplicationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -63059,10 +63872,11 @@ func (p AppStreamApplicationPaginator) NextPage(ctx context.Context) ([]AppStrea } var listAppStreamApplicationFilters = map[string]string{ - "arn": "Description.Application.Arn", - "name": "Description.Application.Name", - "tags": "Description.Tags", - "title": "Description.Application.Name", + "arn": "Description.Application.Arn", + "name": "Description.Application.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Application.Name", } func ListAppStreamApplication(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -63126,10 +63940,11 @@ func ListAppStreamApplication(ctx context.Context, d *plugin.QueryData, _ *plugi } var getAppStreamApplicationFilters = map[string]string{ - "arn": "Description.Application.Arn", - "name": "description.Application.Name", - "tags": "Description.Tags", - "title": "Description.Application.Name", + "arn": "Description.Application.Arn", + "name": "description.Application.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Application.Name", } func GetAppStreamApplication(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -63193,6 +64008,7 @@ type AppStreamStack struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AppStreamStackDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -63267,10 +64083,11 @@ func (p AppStreamStackPaginator) NextPage(ctx context.Context) ([]AppStreamStack } var listAppStreamStackFilters = map[string]string{ - "arn": "Description.Stack.Arn", - "name": "Description.Stack.Name", - "tags": "Description.Tags", - "title": "Description.Stack.Name", + "arn": "Description.Stack.Arn", + "name": "Description.Stack.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Stack.Name", } func ListAppStreamStack(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -63334,10 +64151,11 @@ func ListAppStreamStack(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr } var getAppStreamStackFilters = map[string]string{ - "arn": "Description.Stack.Arn", - "name": "description.Stack.Name", - "tags": "Description.Tags", - "title": "Description.Stack.Name", + "arn": "Description.Stack.Arn", + "name": "description.Stack.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Stack.Name", } func GetAppStreamStack(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -63401,6 +64219,7 @@ type AppStreamFleet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AppStreamFleetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -63493,6 +64312,7 @@ var listAppStreamFleetFilters = map[string]string{ "max_concurrent_sessions": "Description.Fleet.MaxConcurrentSessions", "max_user_duration_in_seconds": "Description.Fleet.MaxUserDurationInSeconds", "name": "Description.Fleet.Name", + "og_account_id": "metadata.IntegrationID", "organizational_unit_distinguished_name": "Description.Fleet.DomainJoinInfo.OrganizationalUnitDistinguishedName", "platform": "Description.Fleet.Platform", "session_script_s3_location": "Description.Fleet.SessionScriptS3Location", @@ -63583,6 +64403,7 @@ var getAppStreamFleetFilters = map[string]string{ "max_concurrent_sessions": "Description.Fleet.MaxConcurrentSessions", "max_user_duration_in_seconds": "Description.Fleet.MaxUserDurationInSeconds", "name": "description.Fleet.Name", + "og_account_id": "metadata.IntegrationID", "organizational_unit_distinguished_name": "Description.Fleet.DomainJoinInfo.OrganizationalUnitDistinguishedName", "platform": "Description.Fleet.Platform", "session_script_s3_location": "Description.Fleet.SessionScriptS3Location", @@ -63655,6 +64476,7 @@ type AppStreamImage struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AppStreamImageDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -63741,6 +64563,7 @@ var listAppStreamImageFilters = map[string]string{ "image_errors": "Description.Image.ImageErrors", "image_permissions": "Description.Image.ImagePermissions", "name": "Description.Image.Name", + "og_account_id": "metadata.IntegrationID", "platform": "Description.Image.Platform", "public_base_image_released_date": "Description.Image.PublicBaseImageReleasedDate", "state": "Description.Image.State", @@ -63823,6 +64646,7 @@ var getAppStreamImageFilters = map[string]string{ "image_errors": "Description.Image.ImageErrors", "image_permissions": "Description.Image.ImagePermissions", "name": "description.Image.Name", + "og_account_id": "metadata.IntegrationID", "platform": "Description.Image.Platform", "public_base_image_released_date": "Description.Image.PublicBaseImageReleasedDate", "state": "Description.Image.State", @@ -63893,6 +64717,7 @@ type AthenaWorkGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AthenaWorkGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -63978,6 +64803,7 @@ var listAthenaWorkGroupFilters = map[string]string{ "execution_role": "Description.WorkGroup.Configuration.ExecutionRole", "expected_bucket_owner": "Description.WorkGroup.Configuration.ResultConfiguration.ExpectedBucketOwner", "name": "Description.WorkGroup.Name", + "og_account_id": "metadata.IntegrationID", "output_location": "Description.WorkGroup.Configuration.ResultConfiguration.OutputLocation", "publish_cloudwatch_metrics_enabled": "Description.WorkGroup.Configuration.PublishCloudWatchMetricsEnabled", "requester_pays_enabled": "Description.WorkGroup.Configuration.RequesterPaysEnabled", @@ -64058,6 +64884,7 @@ var getAthenaWorkGroupFilters = map[string]string{ "execution_role": "Description.WorkGroup.Configuration.ExecutionRole", "expected_bucket_owner": "Description.WorkGroup.Configuration.ResultConfiguration.ExpectedBucketOwner", "name": "description.WorkGroup.Name", + "og_account_id": "metadata.IntegrationID", "output_location": "Description.WorkGroup.Configuration.ResultConfiguration.OutputLocation", "publish_cloudwatch_metrics_enabled": "Description.WorkGroup.Configuration.PublishCloudWatchMetricsEnabled", "requester_pays_enabled": "Description.WorkGroup.Configuration.RequesterPaysEnabled", @@ -64127,6 +64954,7 @@ type AthenaQueryExecution struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AthenaQueryExecutionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -64216,6 +65044,7 @@ var listAthenaQueryExecutionFilters = map[string]string{ "expected_bucket_owner": "Description.QueryExecution.ResultConfiguration.ExpectedBucketOwner", "id": "Description.QueryExecution.QueryExecutionId", "kms_key": "Description.QueryExecution.ResultConfiguration.EncryptionConfiguration.KmsKey", + "og_account_id": "metadata.IntegrationID", "output_location": "Description.QueryExecution.ResultConfiguration.OutputLocation", "query": "Description.QueryExecution.Query", "query_planning_time_in_millis": "Description.QueryExecution.Statistics.QueryPlanningTimeInMillis", @@ -64313,6 +65142,7 @@ var getAthenaQueryExecutionFilters = map[string]string{ "id": "Description.QueryExecution.QueryExecutionId", "kms_key": "Description.QueryExecution.ResultConfiguration.EncryptionConfiguration.KmsKey", "name": "description.QueryExecution.Query", + "og_account_id": "metadata.IntegrationID", "output_location": "Description.QueryExecution.ResultConfiguration.OutputLocation", "query": "Description.QueryExecution.Query", "query_planning_time_in_millis": "Description.QueryExecution.Statistics.QueryPlanningTimeInMillis", @@ -64394,6 +65224,7 @@ type KinesisStream struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KinesisStreamDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -64473,6 +65304,7 @@ var listKinesisStreamFilters = map[string]string{ "enhanced_monitoring": "Description.Stream.EnhancedMonitoring", "has_more_shards": "Description.Stream.HasMoreShards", "key_id": "Description.Stream.KeyId", + "og_account_id": "metadata.IntegrationID", "open_shard_count": "Description.DescriptionSummary.OpenShardCount", "retention_period_hours": "Description.Stream.RetentionPeriodHours", "shards": "Description.Stream.Shards", @@ -64550,6 +65382,7 @@ var getKinesisStreamFilters = map[string]string{ "enhanced_monitoring": "Description.Stream.EnhancedMonitoring", "has_more_shards": "Description.Stream.HasMoreShards", "key_id": "Description.Stream.KeyId", + "og_account_id": "metadata.IntegrationID", "open_shard_count": "Description.DescriptionSummary.OpenShardCount", "retention_period_hours": "Description.Stream.RetentionPeriodHours", "shards": "Description.Stream.Shards", @@ -64622,6 +65455,7 @@ type KinesisVideoStream struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KinesisVideoStreamDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -64701,6 +65535,7 @@ var listKinesisVideoStreamFilters = map[string]string{ "device_name": "Description.Stream.DeviceName", "kms_key_id": "Description.Stream.KmsKeyId", "media_type": "Description.Stream.MediaType", + "og_account_id": "metadata.IntegrationID", "status": "Description.Stream.Status", "stream_arn": "Description.Stream.StreamARN", "stream_name": "Description.Stream.StreamName", @@ -64775,6 +65610,7 @@ var getKinesisVideoStreamFilters = map[string]string{ "device_name": "Description.Stream.DeviceName", "kms_key_id": "Description.Stream.KmsKeyId", "media_type": "Description.Stream.MediaType", + "og_account_id": "metadata.IntegrationID", "status": "Description.Stream.Status", "stream_arn": "Description.Stream.StreamARN", "stream_name": "description.Stream.StreamName", @@ -64844,6 +65680,7 @@ type KinesisConsumer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KinesisConsumerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -64922,6 +65759,7 @@ var listKinesisConsumerFilters = map[string]string{ "consumer_creation_timestamp": "Description.Consumer.ConsumerCreationTimestamp", "consumer_name": "Description.Consumer.ConsumerName", "consumer_status": "Description.Consumer.ConsumerStatus", + "og_account_id": "metadata.IntegrationID", "stream_arn": "Description.StreamARN", "title": "Description.Consumer.ConsumerName", } @@ -64991,6 +65829,7 @@ var getKinesisConsumerFilters = map[string]string{ "consumer_creation_timestamp": "Description.Consumer.ConsumerCreationTimestamp", "consumer_name": "Description.Consumer.ConsumerName", "consumer_status": "Description.Consumer.ConsumerStatus", + "og_account_id": "metadata.IntegrationID", "stream_arn": "Description.StreamARN", "title": "Description.Consumer.ConsumerName", } @@ -65056,6 +65895,7 @@ type KinesisAnalyticsV2Application struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KinesisAnalyticsV2ApplicationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -65139,6 +65979,7 @@ var listKinesisAnalyticsV2ApplicationFilters = map[string]string{ "cloud_watch_logging_option_descriptions": "Description.Application.CloudWatchLoggingOptionDescriptions", "create_timestamp": "Description.Application.CreateTimestamp", "last_update_timestamp": "Description.Application.LastUpdateTimestamp", + "og_account_id": "metadata.IntegrationID", "runtime_environment": "Description.Application.RuntimeEnvironment", "service_execution_role": "Description.Application.ServiceExecutionRole", "tags_src": "Description.Tags", @@ -65215,6 +66056,7 @@ var getKinesisAnalyticsV2ApplicationFilters = map[string]string{ "cloud_watch_logging_option_descriptions": "Description.Application.CloudWatchLoggingOptionDescriptions", "create_timestamp": "Description.Application.CreateTimestamp", "last_update_timestamp": "Description.Application.LastUpdateTimestamp", + "og_account_id": "metadata.IntegrationID", "runtime_environment": "Description.Application.RuntimeEnvironment", "service_execution_role": "Description.Application.ServiceExecutionRole", "tags_src": "Description.Tags", @@ -65282,6 +66124,7 @@ type GlacierVault struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlacierVaultDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -65359,6 +66202,7 @@ var listGlacierVaultFilters = map[string]string{ "creation_date": "Description.Vault.CreationDate", "last_inventory_date": "Description.Vault.LastInventoryDate", "number_of_archives": "Description.Vault.NumberOfArchives", + "og_account_id": "metadata.IntegrationID", "policy": "Description.AccessPolicy.Policy", "size_in_bytes": "Description.Vault.SizeInBytes", "tags": "Description.Tags", @@ -65434,6 +66278,7 @@ var getGlacierVaultFilters = map[string]string{ "creation_date": "Description.Vault.CreationDate", "last_inventory_date": "Description.Vault.LastInventoryDate", "number_of_archives": "Description.Vault.NumberOfArchives", + "og_account_id": "metadata.IntegrationID", "policy": "Description.AccessPolicy.Policy", "size_in_bytes": "Description.Vault.SizeInBytes", "tags": "Description.Tags", @@ -65506,6 +66351,7 @@ type WorkspacesWorkspace struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WorkspacesWorkspaceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -65588,6 +66434,7 @@ var listWorkspacesWorkspaceFilters = map[string]string{ "ip_address": "Description.Workspace.IpAddress", "modification_states": "Description.Workspace.ModificationStates", "name": "Description.Workspace.ComputerName", + "og_account_id": "metadata.IntegrationID", "root_volume_encryption_enabled": "Description.Workspace.RootVolumeEncryptionEnabled", "state": "Description.Workspace.State", "subnet_id": "Description.Workspace.SubnetId", @@ -65669,6 +66516,7 @@ var getWorkspacesWorkspaceFilters = map[string]string{ "ip_address": "Description.Workspace.IpAddress", "modification_states": "Description.Workspace.ModificationStates", "name": "Description.Workspace.ComputerName", + "og_account_id": "metadata.IntegrationID", "root_volume_encryption_enabled": "Description.Workspace.RootVolumeEncryptionEnabled", "state": "Description.Workspace.State", "subnet_id": "Description.Workspace.SubnetId", @@ -65742,6 +66590,7 @@ type WorkspacesBundle struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WorkspacesBundleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -65816,10 +66665,11 @@ func (p WorkspacesBundlePaginator) NextPage(ctx context.Context) ([]WorkspacesBu } var listWorkspacesBundleFilters = map[string]string{ - "arn": "ARN", - "bundle_id": "Description.Bundle.BundleId", - "name": "Description.Bundle.Name", - "title": "Description.Bundle.Name", + "arn": "ARN", + "bundle_id": "Description.Bundle.BundleId", + "name": "Description.Bundle.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Bundle.Name", } func ListWorkspacesBundle(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -65883,10 +66733,11 @@ func ListWorkspacesBundle(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy } var getWorkspacesBundleFilters = map[string]string{ - "arn": "ARN", - "bundle_id": "description.Bundle.BundleId", - "name": "Description.Bundle.Name", - "title": "Description.Bundle.Name", + "arn": "ARN", + "bundle_id": "description.Bundle.BundleId", + "name": "Description.Bundle.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Bundle.Name", } func GetWorkspacesBundle(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -65950,6 +66801,7 @@ type KeyspacesKeyspace struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KeyspacesKeyspaceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -66025,6 +66877,7 @@ func (p KeyspacesKeyspacePaginator) NextPage(ctx context.Context) ([]KeyspacesKe var listKeyspacesKeyspaceFilters = map[string]string{ "keyspace_name": "Description.Keyspace.KeyspaceName", + "og_account_id": "metadata.IntegrationID", "resource_arn": "Description.Keyspace.ResourceArn", "title": "Description.Keyspace.KeyspaceName", } @@ -66091,6 +66944,7 @@ func ListKeyspacesKeyspace(ctx context.Context, d *plugin.QueryData, _ *plugin.H var getKeyspacesKeyspaceFilters = map[string]string{ "keyspace_name": "description.Keyspace.KeyspaceName", + "og_account_id": "metadata.IntegrationID", "resource_arn": "Description.Keyspace.ResourceArn", "title": "Description.Keyspace.KeyspaceName", } @@ -66156,6 +67010,7 @@ type KeyspacesTable struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KeyspacesTableDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -66230,9 +67085,10 @@ func (p KeyspacesTablePaginator) NextPage(ctx context.Context) ([]KeyspacesTable } var listKeyspacesTableFilters = map[string]string{ - "resource_arn": "Description.Table.ResourceArn", - "table_name": "Description.Table.TableName", - "title": "Description.Table.TableName", + "og_account_id": "metadata.IntegrationID", + "resource_arn": "Description.Table.ResourceArn", + "table_name": "Description.Table.TableName", + "title": "Description.Table.TableName", } func ListKeyspacesTable(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -66296,9 +67152,10 @@ func ListKeyspacesTable(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr } var getKeyspacesTableFilters = map[string]string{ - "resource_arn": "Description.Table.ResourceArn", - "table_name": "description.Table.TableName", - "title": "Description.Table.TableName", + "og_account_id": "metadata.IntegrationID", + "resource_arn": "Description.Table.ResourceArn", + "table_name": "description.Table.TableName", + "title": "Description.Table.TableName", } func GetKeyspacesTable(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -66362,6 +67219,7 @@ type GrafanaWorkspace struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GrafanaWorkspaceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -66436,11 +67294,12 @@ func (p GrafanaWorkspacePaginator) NextPage(ctx context.Context) ([]GrafanaWorks } var listGrafanaWorkspaceFilters = map[string]string{ - "arn": "ARN", - "id": "Description.Workspace.Id", - "name": "Description.Workspace.Name", - "tags": "Description.Workspace.Tags", - "title": "Description.Workspace.Name", + "arn": "ARN", + "id": "Description.Workspace.Id", + "name": "Description.Workspace.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Workspace.Tags", + "title": "Description.Workspace.Name", } func ListGrafanaWorkspace(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -66504,11 +67363,12 @@ func ListGrafanaWorkspace(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy } var getGrafanaWorkspaceFilters = map[string]string{ - "arn": "ARN", - "id": "description.Workspace.Id", - "name": "Description.Workspace.Name", - "tags": "Description.Workspace.Tags", - "title": "Description.Workspace.Name", + "arn": "ARN", + "id": "description.Workspace.Id", + "name": "Description.Workspace.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Workspace.Tags", + "title": "Description.Workspace.Name", } func GetGrafanaWorkspace(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -66572,6 +67432,7 @@ type AMPWorkspace struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AMPWorkspaceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -66646,10 +67507,11 @@ func (p AMPWorkspacePaginator) NextPage(ctx context.Context) ([]AMPWorkspace, er } var listAMPWorkspaceFilters = map[string]string{ - "arn": "Description.Workspace.Arn", - "tags": "Description.Workspace.Tags", - "title": "Description.Workspace.WorkspaceId", - "workspace_id": "Description.Workspace.WorkspaceId", + "arn": "Description.Workspace.Arn", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Workspace.Tags", + "title": "Description.Workspace.WorkspaceId", + "workspace_id": "Description.Workspace.WorkspaceId", } func ListAMPWorkspace(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -66713,10 +67575,11 @@ func ListAMPWorkspace(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydrat } var getAMPWorkspaceFilters = map[string]string{ - "arn": "Description.Workspace.Arn", - "tags": "Description.Workspace.Tags", - "title": "Description.Workspace.WorkspaceId", - "workspace_id": "description.Workspace.WorkspaceId", + "arn": "Description.Workspace.Arn", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Workspace.Tags", + "title": "Description.Workspace.WorkspaceId", + "workspace_id": "description.Workspace.WorkspaceId", } func GetAMPWorkspace(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -66780,6 +67643,7 @@ type KafkaCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.KafkaClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -66854,10 +67718,11 @@ func (p KafkaClusterPaginator) NextPage(ctx context.Context) ([]KafkaCluster, er } var listKafkaClusterFilters = map[string]string{ - "arn": "Description.Cluster.ClusterArn", - "cluster_name": "Description.Cluster.ClusterName", - "tags": "Description.Cluster.Tags", - "title": "Description.Cluster.ClusterName", + "arn": "Description.Cluster.ClusterArn", + "cluster_name": "Description.Cluster.ClusterName", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Cluster.Tags", + "title": "Description.Cluster.ClusterName", } func ListKafkaCluster(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -66921,10 +67786,11 @@ func ListKafkaCluster(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydrat } var getKafkaClusterFilters = map[string]string{ - "arn": "Description.Cluster.ClusterArn", - "cluster_name": "description.Cluster.ClusterName", - "tags": "Description.Cluster.Tags", - "title": "Description.Cluster.ClusterName", + "arn": "Description.Cluster.ClusterArn", + "cluster_name": "description.Cluster.ClusterName", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Cluster.Tags", + "title": "Description.Cluster.ClusterName", } func GetKafkaCluster(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -66988,6 +67854,7 @@ type MWAAEnvironment struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.MWAAEnvironmentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -67062,10 +67929,11 @@ func (p MWAAEnvironmentPaginator) NextPage(ctx context.Context) ([]MWAAEnvironme } var listMWAAEnvironmentFilters = map[string]string{ - "arn": "Description.Environment.Arn", - "name": "Description.Environment.Name", - "tags": "Description.Environment.Tags", - "title": "Description.Environment.Name", + "arn": "Description.Environment.Arn", + "name": "Description.Environment.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Environment.Tags", + "title": "Description.Environment.Name", } func ListMWAAEnvironment(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -67129,10 +67997,11 @@ func ListMWAAEnvironment(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd } var getMWAAEnvironmentFilters = map[string]string{ - "arn": "Description.Environment.Arn", - "name": "description.Environment.Name", - "tags": "Description.Environment.Tags", - "title": "Description.Environment.Name", + "arn": "Description.Environment.Arn", + "name": "description.Environment.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Environment.Tags", + "title": "Description.Environment.Name", } func GetMWAAEnvironment(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -67196,6 +68065,7 @@ type MemoryDbCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.MemoryDbClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -67270,9 +68140,10 @@ func (p MemoryDbClusterPaginator) NextPage(ctx context.Context) ([]MemoryDbClust } var listMemoryDbClusterFilters = map[string]string{ - "arn": "Description.Cluster.ARN", - "name": "Description.Cluster.Name", - "title": "Description.Cluster.Name", + "arn": "Description.Cluster.ARN", + "name": "Description.Cluster.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Cluster.Name", } func ListMemoryDbCluster(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -67336,9 +68207,10 @@ func ListMemoryDbCluster(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd } var getMemoryDbClusterFilters = map[string]string{ - "arn": "Description.Cluster.ARN", - "name": "description.Cluster.Name", - "title": "Description.Cluster.Name", + "arn": "Description.Cluster.ARN", + "name": "description.Cluster.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Cluster.Name", } func GetMemoryDbCluster(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -67402,6 +68274,7 @@ type MQBroker struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.MQBrokerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -67496,6 +68369,7 @@ var listMQBrokerFilters = map[string]string{ "ldap_server_metadata": "Description.BrokerDescription.LdapServerMetadata", "logs": "Description.BrokerDescription.Logs", "maintenance_window_start_time": "Description.BrokerDescription.MaintenanceWindowStartTime", + "og_account_id": "metadata.IntegrationID", "pending_authentication_strategy": "Description.BrokerDescription.PendingAuthenticationStrategy", "pending_data_replication_metadata": "Description.BrokerDescription.PendingDataReplicationMetadata", "pending_data_replication_mode": "Description.BrokerDescription.PendingDataReplicationMode", @@ -67593,6 +68467,7 @@ var getMQBrokerFilters = map[string]string{ "ldap_server_metadata": "Description.BrokerDescription.LdapServerMetadata", "logs": "Description.BrokerDescription.Logs", "maintenance_window_start_time": "Description.BrokerDescription.MaintenanceWindowStartTime", + "og_account_id": "metadata.IntegrationID", "pending_authentication_strategy": "Description.BrokerDescription.PendingAuthenticationStrategy", "pending_data_replication_metadata": "Description.BrokerDescription.PendingDataReplicationMetadata", "pending_data_replication_mode": "Description.BrokerDescription.PendingDataReplicationMode", @@ -67670,6 +68545,7 @@ type NeptuneDatabase struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.NeptuneDatabaseDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -67747,6 +68623,7 @@ var listNeptuneDatabaseFilters = map[string]string{ "db_instance_arn": "Description.Database.DBInstanceArn", "db_instance_identifier": "Description.Database.DBInstanceIdentifier", "db_name": "Description.Database.DBName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Database.DBName", } @@ -67814,6 +68691,7 @@ var getNeptuneDatabaseFilters = map[string]string{ "db_instance_arn": "Description.Database.DBInstanceArn", "db_instance_identifier": "description.Database.DBInstanceIdentifier", "db_name": "Description.Database.DBName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Database.DBName", } @@ -67878,6 +68756,7 @@ type NeptuneDatabaseCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.NeptuneDatabaseClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -67979,6 +68858,7 @@ var listNeptuneDatabaseClusterFilters = map[string]string{ "kms_key_id": "Description.Cluster.KmsKeyId", "latest_restorable_time": "Description.Cluster.LatestRestorableTime", "multi_az": "Description.Cluster.MultiAZ", + "og_account_id": "metadata.IntegrationID", "percent_progress": "Description.Cluster.PercentProgress", "port": "Description.Cluster.Port", "preferred_backup_window": "Description.Cluster.PreferredBackupWindow", @@ -68081,6 +68961,7 @@ var getNeptuneDatabaseClusterFilters = map[string]string{ "kms_key_id": "Description.Cluster.KmsKeyId", "latest_restorable_time": "Description.Cluster.LatestRestorableTime", "multi_az": "Description.Cluster.MultiAZ", + "og_account_id": "metadata.IntegrationID", "percent_progress": "Description.Cluster.PercentProgress", "port": "Description.Cluster.Port", "preferred_backup_window": "Description.Cluster.PreferredBackupWindow", @@ -68155,6 +69036,7 @@ type NeptuneDatabaseClusterSnapshot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.NeptuneDatabaseClusterSnapshotDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -68399,6 +69281,7 @@ type OpenSearchDomain struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OpenSearchDomainDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -68492,6 +69375,7 @@ var listOpenSearchDomainFilters = map[string]string{ "engine_version": "Description.Domain.EngineVersion", "log_publishing_options": "Description.Domain.LogPublishingOptions", "node_to_node_encryption_options_enabled": "Description.Domain.NodeToNodeEncryptionOptions.Enabled", + "og_account_id": "metadata.IntegrationID", "processing": "Description.Domain.Processing", "service_software_options": "Description.Domain.ServiceSoftwareOptions", "snapshot_options": "Description.Domain.SnapshotOptions", @@ -68581,6 +69465,7 @@ var getOpenSearchDomainFilters = map[string]string{ "engine_version": "Description.Domain.EngineVersion", "log_publishing_options": "Description.Domain.LogPublishingOptions", "node_to_node_encryption_options_enabled": "Description.Domain.NodeToNodeEncryptionOptions.Enabled", + "og_account_id": "metadata.IntegrationID", "processing": "Description.Domain.Processing", "service_software_options": "Description.Domain.ServiceSoftwareOptions", "snapshot_options": "Description.Domain.SnapshotOptions", @@ -68651,6 +69536,7 @@ type SESConfigurationSet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SESConfigurationSetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -68725,9 +69611,10 @@ func (p SESConfigurationSetPaginator) NextPage(ctx context.Context) ([]SESConfig } var listSESConfigurationSetFilters = map[string]string{ - "arn": "ARN", - "name": "Description.ConfigurationSet.Name", - "title": "Description.ConfigurationSet.Name", + "arn": "ARN", + "name": "Description.ConfigurationSet.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.ConfigurationSet.Name", } func ListSESConfigurationSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -68791,9 +69678,10 @@ func ListSESConfigurationSet(ctx context.Context, d *plugin.QueryData, _ *plugin } var getSESConfigurationSetFilters = map[string]string{ - "arn": "ARN", - "name": "description.ConfigurationSet.Name", - "title": "Description.ConfigurationSet.Name", + "arn": "ARN", + "name": "description.ConfigurationSet.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.ConfigurationSet.Name", } func GetSESConfigurationSet(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -68857,6 +69745,7 @@ type SESIdentity struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SESIdentityDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -68934,6 +69823,7 @@ var listSESIdentityFilters = map[string]string{ "arn": "ARN", "identity_name": "Description.Identity.Name", "identity_type": "description.Identity.IdentityType", + "og_account_id": "metadata.IntegrationID", "title": "Description.Identity.Name", } @@ -69000,6 +69890,7 @@ func ListSESIdentity(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydrate var getSESIdentityFilters = map[string]string{ "arn": "ARN", "identity_name": "description.Identity.IdentityName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Identity.Name", } @@ -69064,6 +69955,7 @@ type SESv2EmailIdentity struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SESv2EmailIdentityDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -69272,6 +70164,7 @@ type CloudFormationStack struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFormationStackDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -69355,6 +70248,7 @@ var listCloudFormationStackFilters = map[string]string{ "last_updated_time": "Description.Stack.LastUpdatedTime", "name": "description.Stack.StackName", "notification_arns": "Description.Stack.NotificationARNs", + "og_account_id": "metadata.IntegrationID", "outputs": "Description.Stack.Outputs", "parameters": "Description.Stack.Parameters", "parent_id": "Description.Stack.ParentId", @@ -69439,6 +70333,7 @@ var getCloudFormationStackFilters = map[string]string{ "last_updated_time": "Description.Stack.LastUpdatedTime", "name": "description.Stack.StackName", "notification_arns": "Description.Stack.NotificationARNs", + "og_account_id": "metadata.IntegrationID", "outputs": "Description.Stack.Outputs", "parameters": "Description.Stack.Parameters", "parent_id": "Description.Stack.ParentId", @@ -69514,6 +70409,7 @@ type CloudFormationStackSet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFormationStackSetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -69597,6 +70493,7 @@ var listCloudFormationStackSetFilters = map[string]string{ "execution_role_name": "Description.StackSet.ExecutionRoleName", "last_drift_check_timestamp": "Description.StackSet.StackSetDriftDetectionDetails.LastDriftCheckTimestamp", "managed_execution": "Description.StackSet.ManagedExecution", + "og_account_id": "metadata.IntegrationID", "organizational_unit_ids": "Description.StackSet.OrganizationalUnitIds", "parameters": "Description.StackSet.Parameters", "permission_model": "Description.StackSet.PermissionModel", @@ -69679,6 +70576,7 @@ var getCloudFormationStackSetFilters = map[string]string{ "execution_role_name": "Description.StackSet.ExecutionRoleName", "last_drift_check_timestamp": "Description.StackSet.StackSetDriftDetectionDetails.LastDriftCheckTimestamp", "managed_execution": "Description.StackSet.ManagedExecution", + "og_account_id": "metadata.IntegrationID", "organizational_unit_ids": "Description.StackSet.OrganizationalUnitIds", "parameters": "Description.StackSet.Parameters", "permission_model": "Description.StackSet.PermissionModel", @@ -69752,6 +70650,7 @@ type CloudFormationStackResource struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudFormationStackResourceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -69832,6 +70731,7 @@ var listCloudFormationStackResourceFilters = map[string]string{ "logical_resource_id": "Description.StackResource.LogicalResourceId", "module_info": "Description.StackResource.ModuleInfo", "name": "description.StackResource.StackName", + "og_account_id": "metadata.IntegrationID", "physical_resource_id": "Description.StackResource.PhysicalResourceId", "resource_status_reason": "Description.StackResource.ResourceStatusReason", "resource_type": "Description.StackResource.ResourceType", @@ -69906,6 +70806,7 @@ var getCloudFormationStackResourceFilters = map[string]string{ "last_updated_timestamp": "Description.StackResource.LastUpdatedTimestamp", "logical_resource_id": "Description.StackResource.LogicalResourceId", "module_info": "Description.StackResource.ModuleInfo", + "og_account_id": "metadata.IntegrationID", "physical_resource_id": "Description.StackResource.PhysicalResourceId", "resource_status_reason": "Description.StackResource.ResourceStatusReason", "resource_type": "Description.StackResource.ResourceType", @@ -69975,6 +70876,7 @@ type CodeCommitRepository struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeCommitRepositoryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -70056,6 +70958,7 @@ var listCodeCommitRepositoryFilters = map[string]string{ "default_branch": "Description.Repository.DefaultBranch", "description": "Description.Repository.RepositoryDescription", "last_modified_date": "Description.Repository.LastModifiedDate", + "og_account_id": "metadata.IntegrationID", "repository_id": "Description.Repository.RepositoryId", "repository_name": "Description.Repository.RepositoryName", "tags": "Description.Tags", @@ -70130,6 +71033,7 @@ var getCodeCommitRepositoryFilters = map[string]string{ "default_branch": "Description.Repository.DefaultBranch", "description": "Description.Repository.RepositoryDescription", "last_modified_date": "Description.Repository.LastModifiedDate", + "og_account_id": "metadata.IntegrationID", "repository_id": "Description.Repository.RepositoryId", "repository_name": "Description.Repository.RepositoryName", "tags": "Description.Tags", @@ -70197,6 +71101,7 @@ type CodePipelinePipeline struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodePipelinePipelineDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -70276,6 +71181,7 @@ var listCodePipelinePipelineFilters = map[string]string{ "created_at": "Description.Metadata.Created", "encryption_key": "Description.Pipeline.ArtifactStore.EncryptionKey", "name": "Description.Pipeline.Name", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.Pipeline.RoleArn", "stages": "Description.Pipeline.Stages", "tags_src": "Description.Tags", @@ -70350,6 +71256,7 @@ var getCodePipelinePipelineFilters = map[string]string{ "created_at": "Description.Metadata.Created", "encryption_key": "Description.Pipeline.ArtifactStore.EncryptionKey", "name": "description.Pipeline.Name", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.Pipeline.RoleArn", "stages": "Description.Pipeline.Stages", "tags_src": "Description.Tags", @@ -70419,6 +71326,7 @@ type DirectoryServiceDirectory struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DirectoryServiceDirectoryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -70505,6 +71413,7 @@ var listDirectoryServiceDirectoryFilters = map[string]string{ "event_topics": "Description.EventTopics", "launch_time": "Description.Directory.LaunchTime", "name": "Description.Directory.Name", + "og_account_id": "metadata.IntegrationID", "owner_directory_description": "Description.Directory.OwnerDirectoryDescription", "radius_settings": "Description.Directory.RadiusSettings", "radius_status": "Description.Directory.RadiusStatus", @@ -70599,6 +71508,7 @@ var getDirectoryServiceDirectoryFilters = map[string]string{ "event_topics": "Description.EventTopics", "launch_time": "Description.Directory.LaunchTime", "name": "description.Directory.DirectoryId", + "og_account_id": "metadata.IntegrationID", "owner_directory_description": "Description.Directory.OwnerDirectoryDescription", "radius_settings": "Description.Directory.RadiusSettings", "radius_status": "Description.Directory.RadiusStatus", @@ -70681,6 +71591,7 @@ type DirectoryServiceCertificate struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DirectoryServiceCertificateDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -70760,6 +71671,7 @@ var listDirectoryServiceCertificateFilters = map[string]string{ "common_name": "Description.Certificate.CommonName", "directory_id": "Description.DirectoryId", "expiry_date_time": "Description.Certificate.ExpiryDateTime", + "og_account_id": "metadata.IntegrationID", "registered_date_time": "Description.Certificate.RegisteredDateTime", "state": "Description.Certificate.State", "state_reason": "Description.Certificate.StateReason", @@ -70834,6 +71746,7 @@ var getDirectoryServiceCertificateFilters = map[string]string{ "directory_id": "Description.DirectoryId", "expiry_date_time": "Description.Certificate.ExpiryDateTime", "name": "description.Certificate.CertificateId", + "og_account_id": "metadata.IntegrationID", "registered_date_time": "Description.Certificate.RegisteredDateTime", "state": "Description.Certificate.State", "state_reason": "Description.Certificate.StateReason", @@ -70902,6 +71815,7 @@ type DirectoryServiceLogSubscription struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DirectoryServiceLogSubscriptionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -70978,6 +71892,7 @@ func (p DirectoryServiceLogSubscriptionPaginator) NextPage(ctx context.Context) var listDirectoryServiceLogSubscriptionFilters = map[string]string{ "directory_id": "Description.LogSubscription.DirectoryId", "log_group_name": "Description.LogSubscription.LogGroupName", + "og_account_id": "metadata.IntegrationID", "subscription_created_date_time": "Description.LogSubscription.SubscriptionCreatedDateTime", "title": "Description.LogSubscription.LogGroupName", } @@ -71045,6 +71960,7 @@ func ListDirectoryServiceLogSubscription(ctx context.Context, d *plugin.QueryDat var getDirectoryServiceLogSubscriptionFilters = map[string]string{ "directory_id": "Description.LogSubscription.DirectoryId", "log_group_name": "Description.LogSubscription.LogGroupName", + "og_account_id": "metadata.IntegrationID", "subscription_created_date_time": "Description.LogSubscription.SubscriptionCreatedDateTime", "title": "Description.LogSubscription.LogGroupName", } @@ -71110,6 +72026,7 @@ type SSOAdminInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSOAdminInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -71186,6 +72103,7 @@ func (p SSOAdminInstancePaginator) NextPage(ctx context.Context) ([]SSOAdminInst var listSSOAdminInstanceFilters = map[string]string{ "arn": "Description.Instance.InstanceArn", "identity_store_id": "Description.Instance.IdentityStoreId", + "og_account_id": "metadata.IntegrationID", "title": "Description.Instance.InstanceArn", } @@ -71252,6 +72170,7 @@ func ListSSOAdminInstance(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy var getSSOAdminInstanceFilters = map[string]string{ "arn": "Description.Instance.InstanceArn", "identity_store_id": "Description.Instance.IdentityStoreId", + "og_account_id": "metadata.IntegrationID", "title": "Description.Instance.InstanceArn", } @@ -71316,6 +72235,7 @@ type SSOAdminAccountAssignment struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSOAdminAccountAssignmentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -71391,6 +72311,7 @@ func (p SSOAdminAccountAssignmentPaginator) NextPage(ctx context.Context) ([]SSO var listSSOAdminAccountAssignmentFilters = map[string]string{ "instance_arn": "Description.Instance.InstanceArn", + "og_account_id": "metadata.IntegrationID", "permission_set_arn": "Description.AccountAssignment.PermissionSetArn", "principal_id": "Description.AccountAssignment.PrincipalId", "principal_type": "Description.AccountAssignment.PrincipalType", @@ -71459,6 +72380,7 @@ func ListSSOAdminAccountAssignment(ctx context.Context, d *plugin.QueryData, _ * var getSSOAdminAccountAssignmentFilters = map[string]string{ "instance_arn": "Description.Instance.InstanceArn", + "og_account_id": "metadata.IntegrationID", "permission_set_arn": "Description.AccountAssignment.PermissionSetArn", "principal_id": "Description.AccountAssignment.PrincipalId", "principal_type": "Description.AccountAssignment.PrincipalType", @@ -71526,6 +72448,7 @@ type SSOAdminPermissionSet struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSOAdminPermissionSetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -71605,6 +72528,7 @@ var listSSOAdminPermissionSetFilters = map[string]string{ "description": "Description.PermissionSet.Description", "instance_arn": "Description.InstanceArn", "name": "Description.PermissionSet.Name", + "og_account_id": "metadata.IntegrationID", "relay_state": "Description.PermissionSet.RelayState", "session_duration": "Description.PermissionSet.SessionDuration", "tags": "Description.Tags", @@ -71678,6 +72602,7 @@ var getSSOAdminPermissionSetFilters = map[string]string{ "description": "Description.PermissionSet.Description", "instance_arn": "Description.InstanceArn", "name": "Description.PermissionSet.Name", + "og_account_id": "metadata.IntegrationID", "relay_state": "Description.PermissionSet.RelayState", "session_duration": "Description.PermissionSet.SessionDuration", "tags": "Description.Tags", @@ -71746,6 +72671,7 @@ type SSOAdminPolicyAttachment struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SSOAdminPolicyAttachmentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -71823,6 +72749,7 @@ var listSSOAdminPolicyAttachmentFilters = map[string]string{ "instance_arn": "Description.InstanceArn", "managed_policy_arn": "Description.AttachedManagedPolicy.Arn", "name": "Description.AttachedManagedPolicy.Name", + "og_account_id": "metadata.IntegrationID", "permission_set_arn": "Description.PermissionSetArn", "title": "Description.AttachedManagedPolicy.Name", } @@ -71891,6 +72818,7 @@ var getSSOAdminPolicyAttachmentFilters = map[string]string{ "instance_arn": "Description.InstanceArn", "managed_policy_arn": "Description.AttachedManagedPolicy.Arn", "name": "Description.AttachedManagedPolicy.Name", + "og_account_id": "metadata.IntegrationID", "permission_set_arn": "Description.PermissionSetArn", "title": "Description.AttachedManagedPolicy.Name", } @@ -71956,6 +72884,7 @@ type UserEffectiveAccess struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.UserEffectiveAccessDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -72032,6 +72961,7 @@ func (p UserEffectiveAccessPaginator) NextPage(ctx context.Context) ([]UserEffec var listUserEffectiveAccessFilters = map[string]string{ "id": "ID", "instance_arn": "Description.Instance.InstanceArn", + "og_account_id": "metadata.IntegrationID", "permission_set_arn": "Description.AccountAssignment.PermissionSetArn", "target_account_id": "Description.AccountAssignment.AccountId", "user_id": "Description.UserId", @@ -72101,6 +73031,7 @@ func ListUserEffectiveAccess(ctx context.Context, d *plugin.QueryData, _ *plugin var getUserEffectiveAccessFilters = map[string]string{ "id": "ID", "instance_arn": "Description.Instance.InstanceArn", + "og_account_id": "metadata.IntegrationID", "permission_set_arn": "Description.AccountAssignment.PermissionSetArn", "target_account_id": "Description.AccountAssignment.AccountId", "user_id": "Description.UserId", @@ -72168,6 +73099,7 @@ type WAFRule struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFRuleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -72242,12 +73174,13 @@ func (p WAFRulePaginator) NextPage(ctx context.Context) ([]WAFRule, error) { } var listWAFRuleFilters = map[string]string{ - "metric_name": "Description.Rule.MetricName", - "name": "Description.Rule.Name", - "predicates": "Description.Rule.Predicates", - "rule_id": "Description.Rule.RuleId", - "tags_src": "Description.Tags", - "title": "Description.Rule.Name", + "metric_name": "Description.Rule.MetricName", + "name": "Description.Rule.Name", + "og_account_id": "metadata.IntegrationID", + "predicates": "Description.Rule.Predicates", + "rule_id": "Description.Rule.RuleId", + "tags_src": "Description.Tags", + "title": "Description.Rule.Name", } func ListWAFRule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -72311,12 +73244,13 @@ func ListWAFRule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData } var getWAFRuleFilters = map[string]string{ - "metric_name": "Description.Rule.MetricName", - "name": "Description.Rule.Name", - "predicates": "Description.Rule.Predicates", - "rule_id": "description.Rule.RuleId", - "tags_src": "Description.Tags", - "title": "Description.Rule.Name", + "metric_name": "Description.Rule.MetricName", + "name": "Description.Rule.Name", + "og_account_id": "metadata.IntegrationID", + "predicates": "Description.Rule.Predicates", + "rule_id": "description.Rule.RuleId", + "tags_src": "Description.Tags", + "title": "Description.Rule.Name", } func GetWAFRule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -72380,6 +73314,7 @@ type WAFRegionalRule struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFRegionalRuleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -72454,12 +73389,13 @@ func (p WAFRegionalRulePaginator) NextPage(ctx context.Context) ([]WAFRegionalRu } var listWAFRegionalRuleFilters = map[string]string{ - "arn": "ARN", - "metric_name": "Description.Rule.MetricName", - "name": "Description.Rule.Name", - "predicates": "Description.Rule.Predicates", - "rule_id": "Description.Rule.RuleId", - "title": "Description.Rule.Name", + "arn": "ARN", + "metric_name": "Description.Rule.MetricName", + "name": "Description.Rule.Name", + "og_account_id": "metadata.IntegrationID", + "predicates": "Description.Rule.Predicates", + "rule_id": "Description.Rule.RuleId", + "title": "Description.Rule.Name", } func ListWAFRegionalRule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -72523,12 +73459,13 @@ func ListWAFRegionalRule(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd } var getWAFRegionalRuleFilters = map[string]string{ - "arn": "ARN", - "metric_name": "Description.Rule.MetricName", - "name": "Description.Rule.Name", - "predicates": "Description.Rule.Predicates", - "rule_id": "description.Rule.RuleId", - "title": "Description.Rule.Name", + "arn": "ARN", + "metric_name": "Description.Rule.MetricName", + "name": "Description.Rule.Name", + "og_account_id": "metadata.IntegrationID", + "predicates": "Description.Rule.Predicates", + "rule_id": "description.Rule.RuleId", + "title": "Description.Rule.Name", } func GetWAFRegionalRule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -72592,6 +73529,7 @@ type WAFRateBasedRule struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFRateBasedRuleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -72666,15 +73604,16 @@ func (p WAFRateBasedRulePaginator) NextPage(ctx context.Context) ([]WAFRateBased } var listWAFRateBasedRuleFilters = map[string]string{ - "akas": "Description.ARN", - "metric_name": "Description.Rule.MetricName", - "name": "Description.Rule.Name", - "predicates": "Description.Rule.MatchPredicates", - "rate_key": "Description.Rule.RateKey", - "rate_limit": "Description.Rule.RateLimit", - "rule_id": "Description.Rule.RuleId", - "tags_src": "Description.Tags.TagList", - "title": "Description.Rule.Name", + "akas": "Description.ARN", + "metric_name": "Description.Rule.MetricName", + "name": "Description.Rule.Name", + "og_account_id": "metadata.IntegrationID", + "predicates": "Description.Rule.MatchPredicates", + "rate_key": "Description.Rule.RateKey", + "rate_limit": "Description.Rule.RateLimit", + "rule_id": "Description.Rule.RuleId", + "tags_src": "Description.Tags.TagList", + "title": "Description.Rule.Name", } func ListWAFRateBasedRule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -72738,15 +73677,16 @@ func ListWAFRateBasedRule(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy } var getWAFRateBasedRuleFilters = map[string]string{ - "akas": "Description.ARN", - "metric_name": "Description.Rule.MetricName", - "name": "Description.Rule.Name", - "predicates": "Description.Rule.MatchPredicates", - "rate_key": "Description.Rule.RateKey", - "rate_limit": "Description.Rule.RateLimit", - "rule_id": "description.Rule.RuleId", - "tags_src": "Description.Tags.TagList", - "title": "Description.Rule.Name", + "akas": "Description.ARN", + "metric_name": "Description.Rule.MetricName", + "name": "Description.Rule.Name", + "og_account_id": "metadata.IntegrationID", + "predicates": "Description.Rule.MatchPredicates", + "rate_key": "Description.Rule.RateKey", + "rate_limit": "Description.Rule.RateLimit", + "rule_id": "description.Rule.RuleId", + "tags_src": "Description.Tags.TagList", + "title": "Description.Rule.Name", } func GetWAFRateBasedRule(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -72810,6 +73750,7 @@ type WAFRuleGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFRuleGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -72888,6 +73829,7 @@ var listWAFRuleGroupFilters = map[string]string{ "arn": "Description.ARN", "metric_name": "Description.RuleGroup.RuleGroup.MetricName", "name": "Description.RuleGroupSummary.Name", + "og_account_id": "metadata.IntegrationID", "rule_group_id": "Description.RuleGroupSummary.RuleGroupId", "tags_src": "Description.Tags", "title": "Description.RuleGroupSummary.Name", @@ -72958,6 +73900,7 @@ var getWAFRuleGroupFilters = map[string]string{ "arn": "Description.ARN", "metric_name": "Description.RuleGroup.RuleGroup.MetricName", "name": "Description.RuleGroupSummary.Name", + "og_account_id": "metadata.IntegrationID", "rule_group_id": "description.Rule.RuleId", "tags_src": "Description.Tags", "title": "Description.RuleGroupSummary.Name", @@ -73024,6 +73967,7 @@ type WAFWebAcl struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFWebAclDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -73103,6 +74047,7 @@ var listWAFWebAclFilters = map[string]string{ "logging_configuration": "Description.LoggingConfiguration", "metric_name": "Description.WebACL.MetricName", "name": "Description.WebACL.Name", + "og_account_id": "metadata.IntegrationID", "rules": "Description.WebACL.Rules", "tags_src": "Description.Tags.TagList", "title": "Description.WebACL.Name", @@ -73175,6 +74120,7 @@ var getWAFWebAclFilters = map[string]string{ "logging_configuration": "Description.LoggingConfiguration", "metric_name": "Description.WebACL.MetricName", "name": "Description.WebACL.Name", + "og_account_id": "metadata.IntegrationID", "rules": "Description.WebACL.Rules", "tags_src": "Description.Tags.TagList", "title": "Description.WebACL.Name", @@ -73242,6 +74188,7 @@ type WellArchitectedWorkload struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedWorkloadDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -73328,6 +74275,7 @@ var listWellArchitectedWorkloadFilters = map[string]string{ "lenses": "Description.Workload.Lenses", "non_aws_regions": "Description.Workload.NonAwsRegions", "notes": "Description.Workload.Notes", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Workload.Owner", "pillar_priorities": "Description.Workload.PillarPriorities", "review_owner": "Description.Workload.ReviewOwner", @@ -73415,6 +74363,7 @@ var getWellArchitectedWorkloadFilters = map[string]string{ "lenses": "Description.Workload.Lenses", "non_aws_regions": "Description.Workload.NonAwsRegions", "notes": "Description.Workload.Notes", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Workload.Owner", "pillar_priorities": "Description.Workload.PillarPriorities", "review_owner": "Description.Workload.ReviewOwner", @@ -73490,6 +74439,7 @@ type WellArchitectedAnswer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedAnswerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -73574,6 +74524,7 @@ var listWellArchitectedAnswerFilters = map[string]string{ "lens_arn": "Description.LensArn", "milestone_number": "Description.MilestoneNumber", "notes": "Description.Answer.Notes", + "og_account_id": "metadata.IntegrationID", "pillar_id": "Description.Answer.PillarId", "question_description": "Description.Answer.QuestionDescription", "question_id": "Description.Answer.QuestionId", @@ -73656,6 +74607,7 @@ var getWellArchitectedAnswerFilters = map[string]string{ "lens_arn": "Description.LensArn", "milestone_number": "Description.MilestoneNumber", "notes": "Description.Answer.Notes", + "og_account_id": "metadata.IntegrationID", "pillar_id": "Description.Answer.PillarId", "question_description": "Description.Answer.QuestionDescription", "question_id": "Description.Answer.QuestionId", @@ -73728,6 +74680,7 @@ type WellArchitectedCheckDetail struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedCheckDetailDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -73808,6 +74761,7 @@ var listWellArchitectedCheckDetailFilters = map[string]string{ "id": "Description.CheckDetail.Id", "lens_arn": "Description.CheckDetail.LensArn", "name": "Description.CheckDetail.Name", + "og_account_id": "metadata.IntegrationID", "owner_account_id": "Description.CheckDetail.AccountId", "pillar_id": "Description.CheckDetail.PillarId", "provider": "Description.CheckDetail.Provider", @@ -73886,6 +74840,7 @@ var getWellArchitectedCheckDetailFilters = map[string]string{ "id": "Description.CheckDetail.Id", "lens_arn": "Description.CheckDetail.LensArn", "name": "Description.CheckDetail.Name", + "og_account_id": "metadata.IntegrationID", "owner_account_id": "Description.CheckDetail.AccountId", "pillar_id": "Description.CheckDetail.PillarId", "provider": "Description.CheckDetail.Provider", @@ -73958,6 +74913,7 @@ type WellArchitectedCheckSummary struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedCheckSummaryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -74038,6 +74994,7 @@ var listWellArchitectedCheckSummaryFilters = map[string]string{ "id": "Description.CheckSummary.ChoiceId", "lens_arn": "Description.CheckSummary.LensArn", "name": "Description.CheckSummary.Name", + "og_account_id": "metadata.IntegrationID", "pillar_id": "Description.CheckSummary.PillarId", "provider": "Description.CheckSummary.Provider", "question_id": "Description.CheckSummary.QuestionId", @@ -74114,6 +75071,7 @@ var getWellArchitectedCheckSummaryFilters = map[string]string{ "id": "Description.CheckSummary.ChoiceId", "lens_arn": "Description.CheckSummary.LensArn", "name": "Description.CheckSummary.Name", + "og_account_id": "metadata.IntegrationID", "pillar_id": "Description.CheckSummary.PillarId", "provider": "Description.CheckSummary.Provider", "question_id": "Description.CheckSummary.QuestionId", @@ -74184,6 +75142,7 @@ type WellArchitectedCheckConsolidatedReport struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedCheckConsolidatedReportDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -74263,6 +75222,7 @@ var listWellArchitectedCheckConsolidatedReportFilters = map[string]string{ "lenses": "Description.ConsolidateReport.Lenses", "lenses_applied_count": "Description.ConsolidateReport.LensesAppliedCount", "metric_type": "Description.ConsolidateReport.MetricType", + "og_account_id": "metadata.IntegrationID", "risk_counts": "Description.ConsolidateReport.RiskCounts", "updated_at": "Description.ConsolidateReport.UpdatedAt", "workload_arn": "Description.ConsolidateReport.WorkloadArn", @@ -74336,6 +75296,7 @@ var getWellArchitectedCheckConsolidatedReportFilters = map[string]string{ "lenses": "Description.ConsolidateReport.Lenses", "lenses_applied_count": "Description.ConsolidateReport.LensesAppliedCount", "metric_type": "Description.ConsolidateReport.MetricType", + "og_account_id": "metadata.IntegrationID", "risk_counts": "Description.ConsolidateReport.RiskCounts", "updated_at": "Description.ConsolidateReport.UpdatedAt", "workload_arn": "Description.ConsolidateReport.WorkloadArn", @@ -74404,6 +75365,7 @@ type WellArchitectedLens struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedLensDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -74485,6 +75447,7 @@ var listWellArchitectedLensFilters = map[string]string{ "lens_name": "Description.LensSummary.LensName", "lens_status": "Description.LensSummary.LensStatus", "lens_version": "Description.LensSummary.LensVersion", + "og_account_id": "metadata.IntegrationID", "owner": "Description.LensSummary.Owner", "share_invitation_id": "Description.Lens.ShareInvitationId", "tags": "Description.Lens.Tags", @@ -74560,6 +75523,7 @@ var getWellArchitectedLensFilters = map[string]string{ "lens_name": "Description.LensSummary.LensName", "lens_status": "Description.LensSummary.LensStatus", "lens_version": "Description.LensSummary.LensVersion", + "og_account_id": "metadata.IntegrationID", "owner": "Description.LensSummary.Owner", "share_invitation_id": "Description.Lens.ShareInvitationId", "tags": "Description.Lens.Tags", @@ -74628,6 +75592,7 @@ type WellArchitectedLensReview struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedLensReviewDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -74708,6 +75673,7 @@ var listWellArchitectedLensReviewFilters = map[string]string{ "lens_status": "Description.LensReview.LensStatus", "lens_version": "Description.LensReview.LensVersion", "notes": "Description.LensReview.Notes", + "og_account_id": "metadata.IntegrationID", "pillar_review_summaries": "Description.LensReview.PillarReviewSummaries", "risk_counts": "Description.LensReview.RiskCounts", "title": "Description.LensReview.LensName", @@ -74781,6 +75747,7 @@ var getWellArchitectedLensReviewFilters = map[string]string{ "lens_status": "Description.LensReview.LensStatus", "lens_version": "Description.LensReview.LensVersion", "notes": "Description.LensReview.Notes", + "og_account_id": "metadata.IntegrationID", "pillar_review_summaries": "Description.LensReview.PillarReviewSummaries", "risk_counts": "Description.LensReview.RiskCounts", "title": "Description.LensReview.LensName", @@ -74848,6 +75815,7 @@ type WellArchitectedLensReviewImprovement struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedLensReviewImprovementDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -74927,6 +75895,7 @@ var listWellArchitectedLensReviewImprovementFilters = map[string]string{ "lens_alias": "Description.LensAlias", "lens_arn": "Description.LensArn", "milestone_number": "Description.MilestoneNumber", + "og_account_id": "metadata.IntegrationID", "pillar_id": "Description.ImprovementSummary.PillarId", "question_id": "Description.ImprovementSummary.QuestionId", "question_title": "Description.ImprovementSummary.QuestionTitle", @@ -75001,6 +75970,7 @@ var getWellArchitectedLensReviewImprovementFilters = map[string]string{ "lens_alias": "Description.LensAlias", "lens_arn": "Description.LensArn", "milestone_number": "Description.MilestoneNumber", + "og_account_id": "metadata.IntegrationID", "pillar_id": "Description.ImprovementSummary.PillarId", "question_id": "Description.ImprovementSummary.QuestionId", "question_title": "Description.ImprovementSummary.QuestionTitle", @@ -75070,6 +76040,7 @@ type WellArchitectedLensReviewReport struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedLensReviewReportDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -75148,6 +76119,7 @@ var listWellArchitectedLensReviewReportFilters = map[string]string{ "lens_alias": "Description.Report.LensAlias", "lens_arn": "Description.Report.LensArn", "milestone_number": "Description.MilestoneNumber", + "og_account_id": "metadata.IntegrationID", "workload_id": "Description.WorkloadId", } @@ -75216,6 +76188,7 @@ var getWellArchitectedLensReviewReportFilters = map[string]string{ "lens_alias": "Description.Report.LensAlias", "lens_arn": "Description.Report.LensArn", "milestone_number": "Description.MilestoneNumber", + "og_account_id": "metadata.IntegrationID", "workload_id": "description.WorkloadId", } @@ -75280,6 +76253,7 @@ type WellArchitectedLensShare struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedLensShareDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -75357,6 +76331,7 @@ var listWellArchitectedLensShareFilters = map[string]string{ "lens_alias": "Description.Lens.LensAlias", "lens_arn": "Description.Lens.LensArn", "lens_name": "Description.Lens.Name", + "og_account_id": "metadata.IntegrationID", "share_id": "Description.Share.ShareId", "shared_with": "Description.Share.SharedWith", "status": "Description.Share.Status", @@ -75428,6 +76403,7 @@ var getWellArchitectedLensShareFilters = map[string]string{ "lens_alias": "Description.Lens.LensAlias", "lens_arn": "Description.Lens.LensArn", "lens_name": "Description.Lens.Name", + "og_account_id": "metadata.IntegrationID", "share_id": "Description.Share.ShareId", "shared_with": "Description.Share.SharedWith", "status": "Description.Share.Status", @@ -75496,6 +76472,7 @@ type WellArchitectedMilestone struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedMilestoneDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -75572,6 +76549,7 @@ func (p WellArchitectedMilestonePaginator) NextPage(ctx context.Context) ([]Well var listWellArchitectedMilestoneFilters = map[string]string{ "milestone_name": "Description.Milestone.MilestoneName", "milestone_number": "Description.Milestone.MilestoneNumber", + "og_account_id": "metadata.IntegrationID", "recorded_at": "Description.Milestone.RecordedAt", "workload": "Description.Milestone.Workload", "workload_id": "Description.Milestone.Workload.WorkloadId", @@ -75640,6 +76618,7 @@ func ListWellArchitectedMilestone(ctx context.Context, d *plugin.QueryData, _ *p var getWellArchitectedMilestoneFilters = map[string]string{ "milestone_name": "Description.Milestone.MilestoneName", "milestone_number": "Description.Milestone.MilestoneNumber", + "og_account_id": "metadata.IntegrationID", "recorded_at": "Description.Milestone.RecordedAt", "workload": "Description.Milestone.Workload", "workload_id": "Description.Milestone.Workload.WorkloadId", @@ -75706,6 +76685,7 @@ type WellArchitectedNotification struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedNotificationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -75784,6 +76764,7 @@ var listWellArchitectedNotificationFilters = map[string]string{ "latest_lens_version": "Description.Notification.LensUpgradeSummary.LatestLensVersion", "lens_alias": "Description.Notification.LensUpgradeSummary.LensAlias", "lens_arn": "Description.Notification.LensUpgradeSummary.LensArn", + "og_account_id": "metadata.IntegrationID", "type": "Description.Notification.Type", "workload_id": "Description.Notification.LensUpgradeSummary.WorkloadId", "workload_name": "Description.Notification.LensUpgradeSummary.WorkloadName", @@ -75854,6 +76835,7 @@ var getWellArchitectedNotificationFilters = map[string]string{ "latest_lens_version": "Description.Notification.LensUpgradeSummary.LatestLensVersion", "lens_alias": "Description.Notification.LensUpgradeSummary.LensAlias", "lens_arn": "Description.Notification.LensUpgradeSummary.LensArn", + "og_account_id": "metadata.IntegrationID", "type": "Description.Notification.Type", "workload_id": "Description.Notification.LensUpgradeSummary.WorkloadId", "workload_name": "Description.Notification.LensUpgradeSummary.WorkloadName", @@ -75920,6 +76902,7 @@ type WellArchitectedShareInvitation struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedShareInvitationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -75996,6 +76979,7 @@ func (p WellArchitectedShareInvitationPaginator) NextPage(ctx context.Context) ( var listWellArchitectedShareInvitationFilters = map[string]string{ "lens_arn": "Description.ShareInvitation.LensArn", "lens_name": "Description.ShareInvitation.LensName", + "og_account_id": "metadata.IntegrationID", "permission_type": "Description.ShareInvitation.PermissionType", "share_invitation_id": "Description.ShareInvitation.ShareInvitationId", "shared_by": "Description.ShareInvitation.SharedBy", @@ -76068,6 +77052,7 @@ func ListWellArchitectedShareInvitation(ctx context.Context, d *plugin.QueryData var getWellArchitectedShareInvitationFilters = map[string]string{ "lens_arn": "Description.ShareInvitation.LensArn", "lens_name": "Description.ShareInvitation.LensName", + "og_account_id": "metadata.IntegrationID", "permission_type": "Description.ShareInvitation.PermissionType", "share_invitation_id": "Description.ShareInvitation.ShareInvitationId", "shared_by": "Description.ShareInvitation.SharedBy", @@ -76138,6 +77123,7 @@ type WellArchitectedWorkloadShare struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WellArchitectedWorkloadShareDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -76213,6 +77199,7 @@ func (p WellArchitectedWorkloadSharePaginator) NextPage(ctx context.Context) ([] var listWellArchitectedWorkloadShareFilters = map[string]string{ "akas": "Description.Arn", + "og_account_id": "metadata.IntegrationID", "permission_type": "Description.Share.PermissionType", "share_id": "Description.Share.ShareId", "shared_with": "Description.Share.SharedWith", @@ -76284,6 +77271,7 @@ func ListWellArchitectedWorkloadShare(ctx context.Context, d *plugin.QueryData, var getWellArchitectedWorkloadShareFilters = map[string]string{ "akas": "Description.Arn", + "og_account_id": "metadata.IntegrationID", "permission_type": "Description.Share.PermissionType", "share_id": "Description.Share.ShareId", "shared_with": "Description.Share.SharedWith", @@ -76354,6 +77342,7 @@ type WAFRegionalWebAcl struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFRegionalWebAclDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -76433,6 +77422,7 @@ var listWAFRegionalWebAclFilters = map[string]string{ "logging_configuration": "Description.LoggingConfiguration", "metric_name": "Description.WebACL.MetricName", "name": "Description.WebACL.Name", + "og_account_id": "metadata.IntegrationID", "resources": "Description.AssociatedResources", "rules": "Description.WebACL.Rules", "tags": "Description.Tags", @@ -76507,6 +77497,7 @@ var getWAFRegionalWebAclFilters = map[string]string{ "logging_configuration": "Description.LoggingConfiguration", "metric_name": "Description.WebACL.MetricName", "name": "Description.WebACL.Name", + "og_account_id": "metadata.IntegrationID", "resources": "Description.AssociatedResources", "rules": "Description.WebACL.Rules", "tags": "Description.Tags", @@ -76576,6 +77567,7 @@ type WAFRegionalRuleGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.WAFRegionalRuleGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -76655,6 +77647,7 @@ var listWAFRegionalRuleGroupFilters = map[string]string{ "arn": "Description.ARN", "metric_name": "Description.RuleGroup.MetricName", "name": "Description.RuleGroup.Name", + "og_account_id": "metadata.IntegrationID", "rule_group_id": "Description.RuleGroup.RuleGroupId", "tags": "Description.Tags", "tags_src": "Description.Tags", @@ -76727,6 +77720,7 @@ var getWAFRegionalRuleGroupFilters = map[string]string{ "arn": "Description.ARN", "metric_name": "Description.RuleGroup.MetricName", "name": "Description.RuleGroup.Name", + "og_account_id": "metadata.IntegrationID", "rule_group_id": "description.Rule.RuleId", "tags": "Description.Tags", "tags_src": "Description.Tags", @@ -76794,6 +77788,7 @@ type Route53HostedZone struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53HostedZoneDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -76876,6 +77871,7 @@ var listRoute53HostedZoneFilters = map[string]string{ "linked_service_description": "Description.HostedZone.LinkedService.Description", "linked_service_principal": "Description.HostedZone.LinkedService.ServicePrincipal", "name": "Description.HostedZone.Name", + "og_account_id": "metadata.IntegrationID", "private_zone": "Description.HostedZone.Config.PrivateZone", "query_logging_configs": "Description.QueryLoggingConfigs", "resource_record_set_count": "Description.HostedZone.ResourceRecordSetCount", @@ -76954,6 +77950,7 @@ var getRoute53HostedZoneFilters = map[string]string{ "linked_service_description": "Description.HostedZone.LinkedService.Description", "linked_service_principal": "Description.HostedZone.LinkedService.ServicePrincipal", "name": "Description.HostedZone.Name", + "og_account_id": "metadata.IntegrationID", "private_zone": "Description.HostedZone.Config.PrivateZone", "query_logging_configs": "Description.QueryLoggingConfigs", "resource_record_set_count": "Description.HostedZone.ResourceRecordSetCount", @@ -77024,6 +78021,7 @@ type Route53HealthCheck struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53HealthCheckDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -77106,6 +78104,7 @@ var listRoute53HealthCheckFilters = map[string]string{ "id": "Description.HealthCheck.Id", "linked_service_description": "Description.HealthCheck.LinkedService.Description", "linked_service_principal": "Description.HealthCheck.LinkedService.ServicePrincipal", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.Tags.ResourceTagSet.Tags", "title": "Description.HealthCheck.Id", } @@ -77179,6 +78178,7 @@ var getRoute53HealthCheckFilters = map[string]string{ "id": "description.HealthCheck.Id", "linked_service_description": "Description.HealthCheck.LinkedService.Description", "linked_service_principal": "Description.HealthCheck.LinkedService.ServicePrincipal", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.Tags.ResourceTagSet.Tags", "title": "Description.HealthCheck.Id", } @@ -77244,6 +78244,7 @@ type Route53ResolverResolverRule struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53ResolverResolverRuleDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -77326,6 +78327,7 @@ var listRoute53ResolverResolverRuleFilters = map[string]string{ "id": "Description.ResolverRole.Id", "modification_time": "Description.ResolverRole.ModificationTime", "name": "description.ResolverRole.Name", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.ResolverRole.OwnerId", "resolver_endpoint_id": "description.ResolverRole.ResolverEndpointId", "resolver_rule_associations": "Description.RuleAssociations.ResolverRuleAssociations", @@ -77407,6 +78409,7 @@ var getRoute53ResolverResolverRuleFilters = map[string]string{ "id": "description.ResolverRole.Id", "modification_time": "Description.ResolverRole.ModificationTime", "name": "Description.ResolverRole.Name", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.ResolverRole.OwnerId", "resolver_endpoint_id": "Description.ResolverRole.ResolverEndpointId", "resolver_rule_associations": "Description.RuleAssociations.ResolverRuleAssociations", @@ -77480,6 +78483,7 @@ type Route53ResolverEndpoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53ResolverEndpointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -77564,6 +78568,7 @@ var listRoute53ResolverEndpointFilters = map[string]string{ "ip_addresses": "Description.IpAddresses", "modification_time": "Description.ResolverEndpoint.ModificationTime", "name": "description.ResolverEndpoint.Name", + "og_account_id": "metadata.IntegrationID", "security_group_ids": "Description.ResolverEndpoint.SecurityGroupIds", "status": "description.ResolverEndpoint.Status", "status_message": "Description.ResolverEndpoint.StatusMessage", @@ -77642,6 +78647,7 @@ var getRoute53ResolverEndpointFilters = map[string]string{ "ip_addresses": "Description.IpAddresses", "modification_time": "Description.ResolverEndpoint.ModificationTime", "name": "Description.ResolverEndpoint.Name", + "og_account_id": "metadata.IntegrationID", "security_group_ids": "Description.ResolverEndpoint.SecurityGroupIds", "status": "Description.ResolverEndpoint.Status", "status_message": "Description.ResolverEndpoint.StatusMessage", @@ -77710,6 +78716,7 @@ type Route53Domain struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53DomainDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -77794,6 +78801,7 @@ var listRoute53DomainFilters = map[string]string{ "domain_name": "Description.Domain.DomainName", "expiration_date": "Description.Domain.ExpirationDate", "nameservers": "Description.Domain.Nameservers", + "og_account_id": "metadata.IntegrationID", "registrant_contact": "Description.Domain.RegistrantContact", "registrant_privacy": "Description.Domain.RegistrantPrivacy", "registrar_name": "Description.Domain.RegistrarName", @@ -77881,6 +78889,7 @@ var getRoute53DomainFilters = map[string]string{ "domain_name": "description.Domain.DomainName", "expiration_date": "Description.Domain.ExpirationDate", "nameservers": "Description.Domain.Nameservers", + "og_account_id": "metadata.IntegrationID", "registrant_contact": "Description.Domain.RegistrantContact", "registrant_privacy": "Description.Domain.RegistrantPrivacy", "registrar_name": "Description.Domain.RegistrarName", @@ -77958,6 +78967,7 @@ type Route53Record struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53RecordDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -78039,6 +79049,7 @@ var listRoute53RecordFilters = map[string]string{ "latency_region": "Description.Record.Region", "multi_value_answer": "Description.Record.MultiValueAnswer", "name": "description.Record.Name", + "og_account_id": "metadata.IntegrationID", "set_identifier": "description.Record.SetIdentifier", "title": "Description.Record.Name", "traffic_policy_instance_id": "Description.Record.TrafficPolicyInstanceId", @@ -78116,6 +79127,7 @@ var getRoute53RecordFilters = map[string]string{ "latency_region": "Description.Record.Region", "multi_value_answer": "Description.Record.MultiValueAnswer", "name": "Description.Record.Name", + "og_account_id": "metadata.IntegrationID", "set_identifier": "Description.Record.SetIdentifier", "title": "Description.Record.Name", "traffic_policy_instance_id": "Description.Record.TrafficPolicyInstanceId", @@ -78186,6 +79198,7 @@ type Route53TrafficPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53TrafficPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -78260,13 +79273,14 @@ func (p Route53TrafficPolicyPaginator) NextPage(ctx context.Context) ([]Route53T } var listRoute53TrafficPolicyFilters = map[string]string{ - "comment": "Description.TrafficPolicy.Comment", - "document": "Description.TrafficPolicy.Document", - "id": "Description.TrafficPolicy.Id", - "name": "Description.TrafficPolicy.Name", - "title": "Description.TrafficPolicy.Name", - "type": "Description.TrafficPolicy.Type", - "version": "Description.TrafficPolicy.Version", + "comment": "Description.TrafficPolicy.Comment", + "document": "Description.TrafficPolicy.Document", + "id": "Description.TrafficPolicy.Id", + "name": "Description.TrafficPolicy.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.TrafficPolicy.Name", + "type": "Description.TrafficPolicy.Type", + "version": "Description.TrafficPolicy.Version", } func ListRoute53TrafficPolicy(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -78330,13 +79344,14 @@ func ListRoute53TrafficPolicy(ctx context.Context, d *plugin.QueryData, _ *plugi } var getRoute53TrafficPolicyFilters = map[string]string{ - "comment": "Description.TrafficPolicy.Comment", - "document": "Description.TrafficPolicy.Document", - "id": "description.TrafficPolicy.Id", - "name": "Description.TrafficPolicy.Name", - "title": "Description.TrafficPolicy.Name", - "type": "Description.TrafficPolicy.Type", - "version": "description.TrafficPolicy.Version", + "comment": "Description.TrafficPolicy.Comment", + "document": "Description.TrafficPolicy.Document", + "id": "description.TrafficPolicy.Id", + "name": "Description.TrafficPolicy.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.TrafficPolicy.Name", + "type": "Description.TrafficPolicy.Type", + "version": "description.TrafficPolicy.Version", } func GetRoute53TrafficPolicy(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -78400,6 +79415,7 @@ type Route53TrafficPolicyInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53TrafficPolicyInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -78478,6 +79494,7 @@ var listRoute53TrafficPolicyInstanceFilters = map[string]string{ "id": "Description.TrafficPolicyInstance.Id", "message": "Description.TrafficPolicyInstance.Message", "name": "Description.TrafficPolicyInstance.Name", + "og_account_id": "metadata.IntegrationID", "state": "Description.TrafficPolicyInstance.State", "title": "Description.TrafficPolicyInstance.Name", "traffic_policy_id": "Description.TrafficPolicyInstance.TrafficPolicyId", @@ -78551,6 +79568,7 @@ var getRoute53TrafficPolicyInstanceFilters = map[string]string{ "id": "description.TrafficPolicyInstance.Id", "message": "Description.TrafficPolicyInstance.Message", "name": "Description.TrafficPolicyInstance.Name", + "og_account_id": "metadata.IntegrationID", "state": "Description.TrafficPolicyInstance.State", "title": "Description.TrafficPolicyInstance.Name", "traffic_policy_id": "Description.TrafficPolicyInstance.TrafficPolicyId", @@ -78620,6 +79638,7 @@ type Route53QueryLog struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53QueryLogDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -78697,6 +79716,7 @@ var listRoute53QueryLogFilters = map[string]string{ "cloud_watch_logs_log_group_arn": "Description.QueryConfig.CloudWatchLogsLogGroupArn", "hosted_zone_id": "Description.QueryConfig.HostedZoneId", "id": "Description.QueryConfig.Id", + "og_account_id": "metadata.IntegrationID", "title": "Description.QueryConfig.Id", } @@ -78764,6 +79784,7 @@ var getRoute53QueryLogFilters = map[string]string{ "cloud_watch_logs_log_group_arn": "Description.QueryConfig.CloudWatchLogsLogGroupArn", "hosted_zone_id": "Description.QueryConfig.HostedZoneId", "id": "description.TrafficPolicyInstance.Id", + "og_account_id": "metadata.IntegrationID", "title": "Description.QueryConfig.Id", } @@ -78828,6 +79849,7 @@ type Route53ResolverQueryLogConfig struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Route53ResolverQueryLogConfigDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -78909,6 +79931,7 @@ var listRoute53ResolverQueryLogConfigFilters = map[string]string{ "destination_arn": "Description.QueryConfig.DestinationArn", "id": "Description.QueryConfig.Id", "name": "Description.QueryConfig.Name", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.QueryConfig.OwnerId", "share_status": "Description.QueryConfig.ShareStatus", "status": "Description.QueryConfig.Status", @@ -78983,6 +80006,7 @@ var getRoute53ResolverQueryLogConfigFilters = map[string]string{ "destination_arn": "Description.QueryConfig.DestinationArn", "id": "description.TrafficPolicyInstance.Id", "name": "Description.QueryConfig.Name", + "og_account_id": "metadata.IntegrationID", "owner_id": "Description.QueryConfig.OwnerId", "share_status": "Description.QueryConfig.ShareStatus", "status": "Description.QueryConfig.Status", @@ -79050,6 +80074,7 @@ type BatchComputeEnvironment struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BatchComputeEnvironmentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -79127,6 +80152,7 @@ var listBatchComputeEnvironmentFilters = map[string]string{ "arn": "Description.ComputeEnvironment.ComputeEnvironmentArn", "compute_environment_name": "Description.ComputeEnvironment.ComputeEnvironmentName", "id": "Description.ComputeEnvironment.Uuid", + "og_account_id": "metadata.IntegrationID", "tags": "Description.ComputeEnvironment.Tags", "title": "Description.ComputeEnvironment.ComputeEnvironmentName", } @@ -79195,6 +80221,7 @@ var getBatchComputeEnvironmentFilters = map[string]string{ "arn": "Description.ComputeEnvironment.ComputeEnvironmentArn", "compute_environment_name": "description.ComputeEnvironment.ComputeEnvironmentName", "id": "Description.ComputeEnvironment.Uuid", + "og_account_id": "metadata.IntegrationID", "tags": "Description.ComputeEnvironment.Tags", "title": "Description.ComputeEnvironment.ComputeEnvironmentName", } @@ -79260,6 +80287,7 @@ type BatchJob struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BatchJobDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -79334,10 +80362,11 @@ func (p BatchJobPaginator) NextPage(ctx context.Context) ([]BatchJob, error) { } var listBatchJobFilters = map[string]string{ - "arn": "Description.Job.JobArn", - "id": "Description.Job.JobId", - "job_name": "Description.Job.JobName", - "title": "Description.Job.JobName", + "arn": "Description.Job.JobArn", + "id": "Description.Job.JobId", + "job_name": "Description.Job.JobName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Job.JobName", } func ListBatchJob(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -79401,10 +80430,11 @@ func ListBatchJob(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateDat } var getBatchJobFilters = map[string]string{ - "arn": "Description.Job.JobArn", - "id": "Description.Job.JobId", - "job_name": "description.Job.JobName", - "title": "Description.Job.JobName", + "arn": "Description.Job.JobArn", + "id": "Description.Job.JobId", + "job_name": "description.Job.JobName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Job.JobName", } func GetBatchJob(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -79468,6 +80498,7 @@ type BatchJobQueue struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.BatchJobQueueDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -79542,11 +80573,12 @@ func (p BatchJobQueuePaginator) NextPage(ctx context.Context) ([]BatchJobQueue, } var listBatchJobQueueFilters = map[string]string{ - "arn": "Description.Queue.ARN", - "id": "Description.Queue.Id", - "name": "Description.Queue.Name", - "tags": "Description.Queue.Tags", - "title": "Description.Queue.Name", + "arn": "Description.Queue.ARN", + "id": "Description.Queue.Id", + "name": "Description.Queue.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Queue.Tags", + "title": "Description.Queue.Name", } func ListBatchJobQueue(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -79614,6 +80646,7 @@ var getBatchJobQueueFilters = map[string]string{ "id": "Description.Queue.Id", "job_queue_name": "description.JobQueue.JobQueueName", "name": "Description.Queue.Name", + "og_account_id": "metadata.IntegrationID", "tags": "Description.Queue.Tags", "title": "Description.Queue.Name", } @@ -79679,6 +80712,7 @@ type CodeArtifactRepository struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeArtifactRepositoryDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -79760,6 +80794,7 @@ var listCodeArtifactRepositoryFilters = map[string]string{ "domain_owner": "Description.Repository.DomainOwner", "external_connections": "Description.Description.ExternalConnections", "name": "Description.Repository.Name", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy.ResourceArn", "policy_std": "Description.Policy", "repository_endpoint": "Description.Endpoints", @@ -79836,6 +80871,7 @@ var getCodeArtifactRepositoryFilters = map[string]string{ "domain_owner": "Description.Repository.DomainOwner", "external_connections": "Description.Description.ExternalConnections", "name": "description.Repository.Name", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy.ResourceArn", "policy_std": "Description.Policy", "repository_endpoint": "Description.Endpoints", @@ -79905,6 +80941,7 @@ type CodeArtifactDomain struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeArtifactDomainDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -79984,6 +81021,7 @@ var listCodeArtifactDomainFilters = map[string]string{ "created_time": "Description.Domain.CreatedTime", "encryption_key": "Description.Domain.EncryptionKey", "name": "Description.Domain.Name", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Domain.Owner", "policy": "Description.Policy", "repository_count": "Description.Domain.RepositoryCount", @@ -80059,6 +81097,7 @@ var getCodeArtifactDomainFilters = map[string]string{ "created_time": "Description.Domain.CreatedTime", "encryption_key": "Description.Domain.EncryptionKey", "name": "description.Domain.Owner", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Domain.Owner", "policy": "Description.Policy", "repository_count": "Description.Domain.RepositoryCount", @@ -80129,6 +81168,7 @@ type CodeDeployDeploymentGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeDeployDeploymentGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -80220,6 +81260,7 @@ var listCodeDeployDeploymentGroupFilters = map[string]string{ "last_attempted_deployment": "Description.DeploymentGroup.LastAttemptedDeployment", "last_successful_deployment": "Description.DeploymentGroup.LastSuccessfulDeployment", "load_balancer_info": "Description.DeploymentGroup.LoadBalancerInfo", + "og_account_id": "metadata.IntegrationID", "on_premises_instance_tag_filters": "Description.DeploymentGroup.OnPremisesInstanceTagFilters", "on_premises_tag_set": "Description.DeploymentGroup.OnPremisesTagSet", "outdated_instances_strategy": "Description.DeploymentGroup.OutdatedInstancesStrategy", @@ -80308,6 +81349,7 @@ var getCodeDeployDeploymentGroupFilters = map[string]string{ "last_attempted_deployment": "Description.DeploymentGroup.LastAttemptedDeployment", "last_successful_deployment": "Description.DeploymentGroup.LastSuccessfulDeployment", "load_balancer_info": "Description.DeploymentGroup.LoadBalancerInfo", + "og_account_id": "metadata.IntegrationID", "on_premises_instance_tag_filters": "Description.DeploymentGroup.OnPremisesInstanceTagFilters", "on_premises_tag_set": "Description.DeploymentGroup.OnPremisesTagSet", "outdated_instances_strategy": "Description.DeploymentGroup.OutdatedInstancesStrategy", @@ -80379,6 +81421,7 @@ type CodeDeployApplication struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeDeployApplicationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -80460,6 +81503,7 @@ var listCodeDeployApplicationFilters = map[string]string{ "create_time": "Description.Application.CreateTime", "github_account_name": "Description.Application.GitHubAccountName", "linked_to_github": "Description.Application.LinkedToGitHub", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.Tags", "title": "Description.Application.ApplicationName", } @@ -80532,6 +81576,7 @@ var getCodeDeployApplicationFilters = map[string]string{ "create_time": "Description.Application.CreateTime", "github_account_name": "Description.Application.GitHubAccountName", "linked_to_github": "Description.Application.LinkedToGitHub", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.Tags", "title": "Description.Application.ApplicationName", } @@ -80597,6 +81642,7 @@ type CodeDeployDeploymentConfig struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeDeployDeploymentConfigDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -80676,6 +81722,7 @@ var listCodeDeployDeploymentConfigFilters = map[string]string{ "deployment_config_id": "Description.Config.DeploymentConfigId", "deployment_config_name": "Description.Config.DeploymentConfigName", "minimum_healthy_hosts": "Description.Config.MinimumHealthyHosts", + "og_account_id": "metadata.IntegrationID", "title": "Description.Config.DeploymentConfigName", "traffic_routing_config": "Description.Config.TrafficRoutingConfig", } @@ -80747,6 +81794,7 @@ var getCodeDeployDeploymentConfigFilters = map[string]string{ "deployment_config_id": "Description.Config.DeploymentConfigId", "deployment_config_name": "Description.Config.DeploymentConfigName", "minimum_healthy_hosts": "Description.Config.MinimumHealthyHosts", + "og_account_id": "metadata.IntegrationID", "title": "Description.Config.DeploymentConfigName", "traffic_routing_config": "Description.Config.TrafficRoutingConfig", } @@ -80812,6 +81860,7 @@ type CodeStarProject struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CodeStarProjectDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -80886,11 +81935,12 @@ func (p CodeStarProjectPaginator) NextPage(ctx context.Context) ([]CodeStarProje } var listCodeStarProjectFilters = map[string]string{ - "arn": "Description.Project.Arn", - "id": "Description.Project.Id", - "name": "Description.Project.Name", - "tags": "Description.Tags", - "title": "Description.Project.Name", + "arn": "Description.Project.Arn", + "id": "Description.Project.Id", + "name": "Description.Project.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Project.Name", } func ListCodeStarProject(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -80954,11 +82004,12 @@ func ListCodeStarProject(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd } var getCodeStarProjectFilters = map[string]string{ - "arn": "Description.Project.Arn", - "id": "description.Project.Id", - "name": "Description.Project.Name", - "tags": "Description.Tags", - "title": "Description.Project.Name", + "arn": "Description.Project.Arn", + "id": "description.Project.Id", + "name": "Description.Project.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Project.Name", } func GetCodeStarProject(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -81022,6 +82073,7 @@ type DirectConnectConnection struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DirectConnectConnectionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -81099,6 +82151,7 @@ var listDirectConnectConnectionFilters = map[string]string{ "arn": "ARN", "connection_id": "Description.Connection.ConnectionId", "name": "Description.Connection.ConnectionName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Connection.ConnectionName", } @@ -81166,6 +82219,7 @@ var getDirectConnectConnectionFilters = map[string]string{ "arn": "ARN", "connection_id": "description.Connection.ConnectionId", "name": "Description.Connection.ConnectionName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Connection.ConnectionName", } @@ -81230,6 +82284,7 @@ type DirectConnectGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DirectConnectGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -81307,6 +82362,7 @@ var listDirectConnectGatewayFilters = map[string]string{ "arn": "ARN", "direct_connect_gateway_id": "Description.Gateway.DirectConnectGatewayId", "name": "Description.Gateway.DirectConnectGatewayName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Gateway.DirectConnectGatewayName", } @@ -81374,6 +82430,7 @@ var getDirectConnectGatewayFilters = map[string]string{ "arn": "ARN", "direct_connect_gateway_id": "description.Gateway.DirectConnectGatewayId", "name": "Description.Gateway.DirectConnectGatewayName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Gateway.DirectConnectGatewayName", } @@ -81438,6 +82495,7 @@ type NetworkFirewallFirewall struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.NetworkFirewallFirewallDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -81520,6 +82578,7 @@ var listNetworkFirewallFirewallFilters = map[string]string{ "id": "Description.Firewall.FirewallId", "logging_configuration": "Description.LoggingConfiguration", "name": "Description.Firewall.FirewallName", + "og_account_id": "metadata.IntegrationID", "policy_arn": "Description.Firewall.FirewallPolicyArn", "policy_change_protection": "Description.Firewall.FirewallPolicyChangeProtection", "subnet_change_protection": "Description.Firewall.SubnetChangeProtection", @@ -81599,6 +82658,7 @@ var getNetworkFirewallFirewallFilters = map[string]string{ "id": "Description.Firewall.FirewallId", "logging_configuration": "Description.LoggingConfiguration", "name": "Description.Firewall.FirewallName", + "og_account_id": "metadata.IntegrationID", "policy_arn": "Description.Firewall.FirewallPolicyArn", "policy_change_protection": "Description.Firewall.FirewallPolicyChangeProtection", "subnet_change_protection": "Description.Firewall.SubnetChangeProtection", @@ -81669,6 +82729,7 @@ type NetworkFirewallFirewallPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.NetworkFirewallFirewallPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -81754,6 +82815,7 @@ var listNetworkFirewallFirewallPolicyFilters = map[string]string{ "last_modified_time": "Description.FirewallPolicyResponse.LastModifiedTime", "name": "Description.FirewallPolicyResponse.FirewallPolicyName", "number_of_associations": "Description.FirewallPolicyResponse.NumberOfAssociations", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.FirewallPolicyResponse.Tags", "title": "Description.FirewallPolicyResponse.FirewallPolicyName", } @@ -81830,6 +82892,7 @@ var getNetworkFirewallFirewallPolicyFilters = map[string]string{ "last_modified_time": "Description.FirewallPolicyResponse.LastModifiedTime", "name": "description.FirewallPolicyResponse.FirewallPolicyName", "number_of_associations": "Description.FirewallPolicyResponse.NumberOfAssociations", + "og_account_id": "metadata.IntegrationID", "tags_src": "Description.FirewallPolicyResponse.Tags", "title": "Description.FirewallPolicyResponse.FirewallPolicyName", } @@ -81895,6 +82958,7 @@ type NetworkFirewallRuleGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.NetworkFirewallRuleGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -81974,6 +83038,7 @@ var listNetworkFirewallRuleGroupFilters = map[string]string{ "consumed_capacity": "Description.RuleGroupResponse.ConsumedCapacity", "description": "Description.RuleGroupResponse.Description", "number_of_associations": "Description.RuleGroupResponse.NumberOfAssociations", + "og_account_id": "metadata.IntegrationID", "rule_group_id": "Description.RuleGroupResponse.RuleGroupId", "rule_group_name": "Description.RuleGroupResponse.RuleGroupName", "rule_group_status": "Description.RuleGroupResponse.RuleGroupStatus", @@ -82051,6 +83116,7 @@ var getNetworkFirewallRuleGroupFilters = map[string]string{ "consumed_capacity": "Description.RuleGroupResponse.ConsumedCapacity", "description": "Description.RuleGroupResponse.Description", "number_of_associations": "Description.RuleGroupResponse.NumberOfAssociations", + "og_account_id": "metadata.IntegrationID", "rule_group_id": "Description.RuleGroupResponse.RuleGroupId", "rule_group_name": "description.RuleGroupResponse.RuleGroupName", "rule_group_status": "Description.RuleGroupResponse.RuleGroupStatus", @@ -82123,6 +83189,7 @@ type OpsWorksCMServer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OpsWorksCMServerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -82197,9 +83264,10 @@ func (p OpsWorksCMServerPaginator) NextPage(ctx context.Context) ([]OpsWorksCMSe } var listOpsWorksCMServerFilters = map[string]string{ - "arn": "Description.Server.ServerArn", - "server_name": "Description.Server.ServerName", - "title": "Description.Server.ServerName", + "arn": "Description.Server.ServerArn", + "og_account_id": "metadata.IntegrationID", + "server_name": "Description.Server.ServerName", + "title": "Description.Server.ServerName", } func ListOpsWorksCMServer(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -82263,9 +83331,10 @@ func ListOpsWorksCMServer(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy } var getOpsWorksCMServerFilters = map[string]string{ - "arn": "Description.Server.ServerArn", - "server_name": "description.Server.ServerName", - "title": "Description.Server.ServerName", + "arn": "Description.Server.ServerArn", + "og_account_id": "metadata.IntegrationID", + "server_name": "description.Server.ServerName", + "title": "Description.Server.ServerName", } func GetOpsWorksCMServer(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -82329,6 +83398,7 @@ type OrganizationsOrganization struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OrganizationsOrganizationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -82403,9 +83473,10 @@ func (p OrganizationsOrganizationPaginator) NextPage(ctx context.Context) ([]Org } var listOrganizationsOrganizationFilters = map[string]string{ - "arn": "Description.Organization.Arn", - "id": "Description.Organization.Id", - "title": "Description.Organization.Id", + "arn": "Description.Organization.Arn", + "id": "Description.Organization.Id", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Organization.Id", } func ListOrganizationsOrganization(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -82469,9 +83540,10 @@ func ListOrganizationsOrganization(ctx context.Context, d *plugin.QueryData, _ * } var getOrganizationsOrganizationFilters = map[string]string{ - "arn": "Description.Organization.Arn", - "id": "description.Organization.Id", - "title": "Description.Organization.Id", + "arn": "Description.Organization.Arn", + "id": "description.Organization.Id", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Organization.Id", } func GetOrganizationsOrganization(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -82535,6 +83607,7 @@ type OrganizationsAccount struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OrganizationsAccountDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -82615,6 +83688,7 @@ var listOrganizationsAccountFilters = map[string]string{ "joined_method": "Description.Account.JoinedMethod", "joined_timestamp": "Description.Account.JoinedTimestamp", "name": "Description.Account.Name", + "og_account_id": "metadata.IntegrationID", "parent_id": "Description.ParentID", "status": "Description.Account.Status", "tags_src": "Description.Tags", @@ -82688,6 +83762,7 @@ var getOrganizationsAccountFilters = map[string]string{ "joined_method": "Description.Account.JoinedMethod", "joined_timestamp": "Description.Account.JoinedTimestamp", "name": "Description.Account.Name", + "og_account_id": "metadata.IntegrationID", "parent_id": "Description.ParentID", "status": "Description.Account.Status", "tags_src": "Description.Tags", @@ -82755,6 +83830,7 @@ type OrganizationsPolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OrganizationsPolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -82829,14 +83905,15 @@ func (p OrganizationsPolicyPaginator) NextPage(ctx context.Context) ([]Organizat } var listOrganizationsPolicyFilters = map[string]string{ - "arn": "Description.Policy.PolicySummary.Arn", - "aws_managed": "Description.Policy.PolicySummary.AwsManaged", - "content": "Description.Policy.Content", - "description": "Description.Policy.PolicySummary.Description", - "id": "Description.Policy.PolicySummary.Id", - "name": "Description.Policy.PolicySummary.Name", - "title": "Description.Policy.PolicySummary.Name", - "type": "Description.Policy.PolicySummary.Type", + "arn": "Description.Policy.PolicySummary.Arn", + "aws_managed": "Description.Policy.PolicySummary.AwsManaged", + "content": "Description.Policy.Content", + "description": "Description.Policy.PolicySummary.Description", + "id": "Description.Policy.PolicySummary.Id", + "name": "Description.Policy.PolicySummary.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Policy.PolicySummary.Name", + "type": "Description.Policy.PolicySummary.Type", } func ListOrganizationsPolicy(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -82900,14 +83977,15 @@ func ListOrganizationsPolicy(ctx context.Context, d *plugin.QueryData, _ *plugin } var getOrganizationsPolicyFilters = map[string]string{ - "arn": "Description.Policy.PolicySummary.Arn", - "aws_managed": "Description.Policy.PolicySummary.AwsManaged", - "content": "Description.Policy.Content", - "description": "Description.Policy.PolicySummary.Description", - "id": "description.Policy.PolicySummary.Id", - "name": "Description.Policy.PolicySummary.Name", - "title": "Description.Policy.PolicySummary.Name", - "type": "Description.Policy.PolicySummary.Type", + "arn": "Description.Policy.PolicySummary.Arn", + "aws_managed": "Description.Policy.PolicySummary.AwsManaged", + "content": "Description.Policy.Content", + "description": "Description.Policy.PolicySummary.Description", + "id": "description.Policy.PolicySummary.Id", + "name": "Description.Policy.PolicySummary.Name", + "og_account_id": "metadata.IntegrationID", + "title": "Description.Policy.PolicySummary.Name", + "type": "Description.Policy.PolicySummary.Type", } func GetOrganizationsPolicy(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -82971,6 +84049,7 @@ type OrganizationsRoot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OrganizationsRootDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -83181,6 +84260,7 @@ type OrganizationsOrganizationalUnit struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OrganizationsOrganizationalUnitDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -83395,6 +84475,7 @@ type OrganizationsPolicyTarget struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OrganizationsPolicyTargetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -83613,6 +84694,7 @@ type PinPointApp struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.PinPointAppDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -83693,6 +84775,7 @@ var listPinPointAppFilters = map[string]string{ "last_modified_date": "Description.Settings.LastModifiedDate", "limits": "Description.Settings.Limits", "name": "Description.App.Name", + "og_account_id": "metadata.IntegrationID", "quiet_time": "Description.Settings.QuietTime", "tags": "Description.App.Tags", "title": "Description.App.Name", @@ -83765,6 +84848,7 @@ var getPinPointAppFilters = map[string]string{ "last_modified_date": "Description.Settings.LastModifiedDate", "limits": "Description.Settings.Limits", "name": "Description.App.Name", + "og_account_id": "metadata.IntegrationID", "quiet_time": "Description.Settings.QuietTime", "tags": "Description.App.Tags", "title": "Description.App.Name", @@ -83831,6 +84915,7 @@ type PipesPipe struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.PipesPipeDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -83914,6 +84999,7 @@ var listPipesPipeFilters = map[string]string{ "enrichment_parameters": "Description.PipeOutput.EnrichmentParameters", "last_modified_time": "Description.Pipe.LastModifiedTime", "name": "Description.Pipe.Name", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.PipeOutput.RoleArn", "source": "Description.Pipe.Source", "state_reason": "Description.Pipe.StateReason", @@ -83993,6 +85079,7 @@ var getPipesPipeFilters = map[string]string{ "enrichment_parameters": "Description.PipeOutput.EnrichmentParameters", "last_modified_time": "Description.Pipe.LastModifiedTime", "name": "description.PipeOutput.Name", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.PipeOutput.RoleArn", "source": "Description.Pipe.Source", "state_reason": "Description.Pipe.StateReason", @@ -84063,6 +85150,7 @@ type ResourceGroupsGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ResourceGroupsGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -84137,9 +85225,10 @@ func (p ResourceGroupsGroupPaginator) NextPage(ctx context.Context) ([]ResourceG } var listResourceGroupsGroupFilters = map[string]string{ - "arn": "Description.GroupIdentifier.GroupArn", - "name": "Description.GroupIdentifier.GroupName", - "title": "Description.GroupIdentifier.GroupName", + "arn": "Description.GroupIdentifier.GroupArn", + "name": "Description.GroupIdentifier.GroupName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.GroupIdentifier.GroupName", } func ListResourceGroupsGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -84203,9 +85292,10 @@ func ListResourceGroupsGroup(ctx context.Context, d *plugin.QueryData, _ *plugin } var getResourceGroupsGroupFilters = map[string]string{ - "arn": "Description.GroupIdentifier.GroupArn", - "name": "description.GroupIdentifier.GroupName", - "title": "Description.GroupIdentifier.GroupName", + "arn": "Description.GroupIdentifier.GroupArn", + "name": "description.GroupIdentifier.GroupName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.GroupIdentifier.GroupName", } func GetResourceGroupsGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -84269,6 +85359,7 @@ type OpenSearchServerlessCollection struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.OpenSearchServerlessCollectionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -84343,10 +85434,11 @@ func (p OpenSearchServerlessCollectionPaginator) NextPage(ctx context.Context) ( } var listOpenSearchServerlessCollectionFilters = map[string]string{ - "arn": "Description.CollectionSummary.Arn", - "name": "Description.Collection.Name", - "tags": "Description.Collection.Tags", - "title": "Description.CollectionSummary.Name", + "arn": "Description.CollectionSummary.Arn", + "name": "Description.Collection.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Collection.Tags", + "title": "Description.CollectionSummary.Name", } func ListOpenSearchServerlessCollection(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -84410,10 +85502,11 @@ func ListOpenSearchServerlessCollection(ctx context.Context, d *plugin.QueryData } var getOpenSearchServerlessCollectionFilters = map[string]string{ - "arn": "Description.CollectionSummary.Arn", - "name": "description.CollectionSummary.Name", - "tags": "Description.Collection.Tags", - "title": "Description.CollectionSummary.Name", + "arn": "Description.CollectionSummary.Arn", + "name": "description.CollectionSummary.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Collection.Tags", + "title": "Description.CollectionSummary.Name", } func GetOpenSearchServerlessCollection(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -84477,6 +85570,7 @@ type TimestreamDatabase struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.TimestreamDatabaseDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -84551,10 +85645,11 @@ func (p TimestreamDatabasePaginator) NextPage(ctx context.Context) ([]Timestream } var listTimestreamDatabaseFilters = map[string]string{ - "arn": "Description.Database.Arn", - "name": "Description.Database.DatabaseName", - "tags": "Description.Tags", - "title": "Description.Database.DatabaseName", + "arn": "Description.Database.Arn", + "name": "Description.Database.DatabaseName", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Database.DatabaseName", } func ListTimestreamDatabase(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -84618,10 +85713,11 @@ func ListTimestreamDatabase(ctx context.Context, d *plugin.QueryData, _ *plugin. } var getTimestreamDatabaseFilters = map[string]string{ - "arn": "description.Database.Arn", - "name": "description.Database.DatabaseName", - "tags": "Description.Tags", - "title": "Description.Database.DatabaseName", + "arn": "description.Database.Arn", + "name": "description.Database.DatabaseName", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Database.DatabaseName", } func GetTimestreamDatabase(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -84685,6 +85781,7 @@ type ResourceExplorer2Index struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ResourceExplorer2IndexDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -84759,9 +85856,10 @@ func (p ResourceExplorer2IndexPaginator) NextPage(ctx context.Context) ([]Resour } var listResourceExplorer2IndexFilters = map[string]string{ - "arn": "Description.Index.Arn", - "region": "description.Index.Region", - "type": "description.Index.Type", + "arn": "Description.Index.Arn", + "og_account_id": "metadata.IntegrationID", + "region": "description.Index.Region", + "type": "description.Index.Type", } func ListResourceExplorer2Index(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -84825,9 +85923,10 @@ func ListResourceExplorer2Index(ctx context.Context, d *plugin.QueryData, _ *plu } var getResourceExplorer2IndexFilters = map[string]string{ - "arn": "Description.Index.Arn", - "region": "Description.Index.Region", - "type": "Description.Index.Type", + "arn": "Description.Index.Arn", + "og_account_id": "metadata.IntegrationID", + "region": "Description.Index.Region", + "type": "Description.Index.Type", } func GetResourceExplorer2Index(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -84891,6 +85990,7 @@ type ResourceExplorer2SupportedResourceType struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ResourceExplorer2SupportedResourceTypeDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -84965,6 +86065,7 @@ func (p ResourceExplorer2SupportedResourceTypePaginator) NextPage(ctx context.Co } var listResourceExplorer2SupportedResourceTypeFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "resource_type": "Description.SupportedResourceType.ResourceType", "service": "Description.SupportedResourceType.Service", } @@ -85030,6 +86131,7 @@ func ListResourceExplorer2SupportedResourceType(ctx context.Context, d *plugin.Q } var getResourceExplorer2SupportedResourceTypeFilters = map[string]string{ + "og_account_id": "metadata.IntegrationID", "resource_type": "Description.SupportedResourceType.ResourceType", "service": "Description.SupportedResourceType.Service", } @@ -85095,6 +86197,7 @@ type StepFunctionsStateMachine struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.StepFunctionsStateMachineDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -85174,6 +86277,7 @@ var listStepFunctionsStateMachineFilters = map[string]string{ "definition": "Description.StateMachine.Definition", "logging_configuration": "Description.StateMachine.LoggingConfiguration", "name": "Description.StateMachine.Name", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.StateMachine.RoleArn", "status": "Description.StateMachine.Status", "tags_src": "Description.Tags", @@ -85248,6 +86352,7 @@ var getStepFunctionsStateMachineFilters = map[string]string{ "definition": "Description.StateMachine.Definition", "logging_configuration": "Description.StateMachine.LoggingConfiguration", "name": "Description.StateMachine.Name", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.StateMachine.RoleArn", "status": "Description.StateMachine.Status", "tags_src": "Description.Tags", @@ -85317,6 +86422,7 @@ type StepFunctionsStateMachineExecutionHistories struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.StepFunctionsStateMachineExecutionHistoriesDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -85416,6 +86522,7 @@ var listStepFunctionsStateMachineExecutionHistoriesFilters = map[string]string{ "map_iteration_started_event_details": "Description.ExecutionHistory.MapIterationStartedEventDetails", "map_iteration_succeeded_event_details": "Description.ExecutionHistory.MapIterationSucceededEventDetails", "map_state_started_event_details": "Description.ExecutionHistory.MapStateStartedEventDetails", + "og_account_id": "metadata.IntegrationID", "previous_event_id": "Description.ExecutionHistory.PreviousEventId", "state_entered_event_details": "Description.ExecutionHistory.StateEnteredEventDetails", "state_exited_event_details": "Description.ExecutionHistory.StateExitedEventDetails", @@ -85518,6 +86625,7 @@ var getStepFunctionsStateMachineExecutionHistoriesFilters = map[string]string{ "map_iteration_started_event_details": "Description.ExecutionHistory.MapIterationStartedEventDetails", "map_iteration_succeeded_event_details": "Description.ExecutionHistory.MapIterationSucceededEventDetails", "map_state_started_event_details": "Description.ExecutionHistory.MapStateStartedEventDetails", + "og_account_id": "metadata.IntegrationID", "previous_event_id": "Description.ExecutionHistory.PreviousEventId", "state_entered_event_details": "Description.ExecutionHistory.StateEnteredEventDetails", "state_exited_event_details": "Description.ExecutionHistory.StateExitedEventDetails", @@ -85595,6 +86703,7 @@ type StepFunctionsStateMachineExecution struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.StepFunctionsStateMachineExecutionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -85673,6 +86782,7 @@ var listStepFunctionsStateMachineExecutionFilters = map[string]string{ "input": "Description.Execution.Input", "input_details": "Description.Execution.InputDetails", "name": "Description.Execution.Name", + "og_account_id": "metadata.IntegrationID", "output": "Description.Execution.Output", "output_details": "Description.Execution.OutputDetails", "start_date": "Description.Execution.StartDate", @@ -85748,6 +86858,7 @@ var getStepFunctionsStateMachineExecutionFilters = map[string]string{ "input": "Description.Execution.Input", "input_details": "Description.Execution.InputDetails", "name": "Description.Execution.Name", + "og_account_id": "metadata.IntegrationID", "output": "Description.Execution.Output", "output_details": "Description.Execution.OutputDetails", "start_date": "Description.Execution.StartDate", @@ -85819,6 +86930,7 @@ type SimSpaceWeaverSimulation struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SimSpaceWeaverSimulationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -85900,6 +87012,7 @@ var listSimSpaceWeaverSimulationFilters = map[string]string{ "logging_configuration": "Description.SimulationItem.LoggingConfiguration", "maximum_duration": "Description.SimulationItem.MaximumDuration", "name": "Description.Simulation.Name", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.SimulationItem.RoleArn", "schema_error": "Description.SimulationItem.SchemaError", "schema_s3_location": "Description.SimulationItem.SchemaS3Location", @@ -85976,6 +87089,7 @@ var getSimSpaceWeaverSimulationFilters = map[string]string{ "logging_configuration": "Description.SimulationItem.LoggingConfiguration", "maximum_duration": "Description.SimulationItem.MaximumDuration", "name": "description.Simulation.Name", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.SimulationItem.RoleArn", "schema_error": "Description.SimulationItem.SchemaError", "schema_s3_location": "Description.SimulationItem.SchemaS3Location", @@ -86045,6 +87159,7 @@ type ACMPCACertificateAuthority struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ACMPCACertificateAuthorityDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -86127,6 +87242,7 @@ var listACMPCACertificateAuthorityFilters = map[string]string{ "last_state_change_at": "Description.CertificateAuthority.LastStateChangeAt", "not_after": "Description.CertificateAuthority.NotAfter", "not_before": "Description.CertificateAuthority.NotBefore", + "og_account_id": "metadata.IntegrationID", "owner_account": "Description.CertificateAuthority.OwnerAccount", "restorable_until": "Description.CertificateAuthority.RestorableUntil", "revocation_configuration": "Description.CertificateAuthority.RevocationConfiguration", @@ -86207,6 +87323,7 @@ var getACMPCACertificateAuthorityFilters = map[string]string{ "last_state_change_at": "Description.CertificateAuthority.LastStateChangeAt", "not_after": "Description.CertificateAuthority.NotAfter", "not_before": "Description.CertificateAuthority.NotBefore", + "og_account_id": "metadata.IntegrationID", "owner_account": "Description.CertificateAuthority.OwnerAccount", "restorable_until": "Description.CertificateAuthority.RestorableUntil", "revocation_configuration": "Description.CertificateAuthority.RevocationConfiguration", @@ -86279,6 +87396,7 @@ type ShieldProtectionGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ShieldProtectionGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -86354,6 +87472,7 @@ func (p ShieldProtectionGroupPaginator) NextPage(ctx context.Context) ([]ShieldP var listShieldProtectionGroupFilters = map[string]string{ "arn": "Description.ProtectionGroup.ProtectionGroupArn", + "og_account_id": "metadata.IntegrationID", "protection_group_id": "Description.ProtectionGroup.ProtectionGroupId", "title": "Description.ProtectionGroup.ProtectionGroupId", } @@ -86420,6 +87539,7 @@ func ListShieldProtectionGroup(ctx context.Context, d *plugin.QueryData, _ *plug var getShieldProtectionGroupFilters = map[string]string{ "arn": "Description.ProtectionGroup.ProtectionGroupArn", + "og_account_id": "metadata.IntegrationID", "protection_group_id": "description.ProtectionGroup.ProtectionGroupId", "title": "Description.ProtectionGroup.ProtectionGroupId", } @@ -86485,6 +87605,7 @@ type StorageGatewayStorageGateway struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.StorageGatewayStorageGatewayDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -86559,10 +87680,11 @@ func (p StorageGatewayStorageGatewayPaginator) NextPage(ctx context.Context) ([] } var listStorageGatewayStorageGatewayFilters = map[string]string{ - "arn": "Description.StorageGateway.GatewayARN", - "gateway_id": "Description.StorageGateway.GatewayId", - "name": "Description.StorageGateway.GatewayName", - "title": "Description.StorageGateway.GatewayName", + "arn": "Description.StorageGateway.GatewayARN", + "gateway_id": "Description.StorageGateway.GatewayId", + "name": "Description.StorageGateway.GatewayName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.StorageGateway.GatewayName", } func ListStorageGatewayStorageGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -86626,10 +87748,11 @@ func ListStorageGatewayStorageGateway(ctx context.Context, d *plugin.QueryData, } var getStorageGatewayStorageGatewayFilters = map[string]string{ - "arn": "Description.StorageGateway.GatewayARN", - "gateway_id": "description.StorageGateway.GatewayId", - "name": "Description.StorageGateway.GatewayName", - "title": "Description.StorageGateway.GatewayName", + "arn": "Description.StorageGateway.GatewayARN", + "gateway_id": "description.StorageGateway.GatewayId", + "name": "Description.StorageGateway.GatewayName", + "og_account_id": "metadata.IntegrationID", + "title": "Description.StorageGateway.GatewayName", } func GetStorageGatewayStorageGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -86693,6 +87816,7 @@ type ImageBuilderImage struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ImageBuilderImageDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -86767,10 +87891,11 @@ func (p ImageBuilderImagePaginator) NextPage(ctx context.Context) ([]ImageBuilde } var listImageBuilderImageFilters = map[string]string{ - "arn": "Description.Image.Arn", - "name": "Description.Image.Name", - "tags": "Description.Image.Tags", - "title": "Description.Image.Name", + "arn": "Description.Image.Arn", + "name": "Description.Image.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Image.Tags", + "title": "Description.Image.Name", } func ListImageBuilderImage(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -86834,10 +87959,11 @@ func ListImageBuilderImage(ctx context.Context, d *plugin.QueryData, _ *plugin.H } var getImageBuilderImageFilters = map[string]string{ - "arn": "Description.Image.Arn", - "name": "description.Image.Name", - "tags": "Description.Image.Tags", - "title": "Description.Image.Name", + "arn": "Description.Image.Arn", + "name": "description.Image.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Image.Tags", + "title": "Description.Image.Name", } func GetImageBuilderImage(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -86901,6 +88027,7 @@ type AccountAlternateContact struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AccountAlternateContactDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -86980,6 +88107,7 @@ var listAccountAlternateContactFilters = map[string]string{ "email_address": "Description.AlternateContact.EmailAddress", "linked_account_id": "description.LinkedAccountID", "name": "Description.AlternateContact.Name", + "og_account_id": "metadata.IntegrationID", "phone_number": "Description.AlternateContact.PhoneNumber", "title": "Description.AlternateContact.Name", } @@ -87050,6 +88178,7 @@ var getAccountAlternateContactFilters = map[string]string{ "email_address": "Description.AlternateContact.EmailAddress", "linked_account_id": "Description.LinkedAccountID", "name": "Description.AlternateContact.Name", + "og_account_id": "metadata.IntegrationID", "phone_number": "Description.AlternateContact.PhoneNumber", "title": "Description.AlternateContact.Name", } @@ -87115,6 +88244,7 @@ type AccountContact struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AccountContactDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -87198,6 +88328,7 @@ var listAccountContactFilters = map[string]string{ "district_or_county": "Description.AlternateContact.DistrictOrCounty", "full_name": "Description.AlternateContact.FullName", "linked_account_id": "description.LinkedAccountID", + "og_account_id": "metadata.IntegrationID", "phone_number": "Description.AlternateContact.PhoneNumber", "postal_code": "Description.AlternateContact.PostalCode", "state_or_region": "Description.AlternateContact.StateOrRegion", @@ -87275,6 +88406,7 @@ var getAccountContactFilters = map[string]string{ "district_or_county": "Description.AlternateContact.DistrictOrCounty", "full_name": "Description.AlternateContact.FullName", "linked_account_id": "Description.LinkedAccountID", + "og_account_id": "metadata.IntegrationID", "phone_number": "Description.AlternateContact.PhoneNumber", "postal_code": "Description.AlternateContact.PostalCode", "state_or_region": "Description.AlternateContact.StateOrRegion", @@ -87343,6 +88475,7 @@ type AmplifyApp struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AmplifyAppDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -87434,6 +88567,7 @@ var listAmplifyAppFilters = map[string]string{ "environment_variables": "Description.App.EnvironmentVariables", "iam_service_role_arn": "Description.App.IamServiceRoleArn", "name": "Description.App.Name", + "og_account_id": "metadata.IntegrationID", "platform": "Description.App.Platform", "production_branch": "Description.App.ProductionBranch", "repository": "Description.App.Repository", @@ -87521,6 +88655,7 @@ var getAmplifyAppFilters = map[string]string{ "environment_variables": "Description.App.EnvironmentVariables", "iam_service_role_arn": "Description.App.IamServiceRoleArn", "name": "Description.App.Name", + "og_account_id": "metadata.IntegrationID", "platform": "Description.App.Platform", "production_branch": "Description.App.ProductionBranch", "repository": "Description.App.Repository", @@ -87591,6 +88726,7 @@ type AppConfigApplication struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AppConfigApplicationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -87665,11 +88801,12 @@ func (p AppConfigApplicationPaginator) NextPage(ctx context.Context) ([]AppConfi } var listAppConfigApplicationFilters = map[string]string{ - "description": "Description.Application.Description", - "id": "Description.Application.Id", - "name": "Description.Application.Name", - "tags": "Description.Tags", - "title": "Description.Application.Name", + "description": "Description.Application.Description", + "id": "Description.Application.Id", + "name": "Description.Application.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Application.Name", } func ListAppConfigApplication(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -87733,11 +88870,12 @@ func ListAppConfigApplication(ctx context.Context, d *plugin.QueryData, _ *plugi } var getAppConfigApplicationFilters = map[string]string{ - "description": "Description.Application.Description", - "id": "description.Application.Id", - "name": "Description.Application.Name", - "tags": "Description.Tags", - "title": "Description.Application.Name", + "description": "Description.Application.Description", + "id": "description.Application.Id", + "name": "Description.Application.Name", + "og_account_id": "metadata.IntegrationID", + "tags": "Description.Tags", + "title": "Description.Application.Name", } func GetAppConfigApplication(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -87801,6 +88939,7 @@ type AuditManagerAssessment struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AuditManagerAssessmentDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -87887,6 +89026,7 @@ var listAuditManagerAssessmentFilters = map[string]string{ "id": "Description.Assessment.Metadata.Id", "last_updated": "Description.Assessment.Metadata.LastUpdated", "name": "Description.Assessment.Metadata.Name", + "og_account_id": "metadata.IntegrationID", "roles": "Description.Assessment.Metadata.Roles", "scope": "Description.Assessment.Metadata.Scope", "status": "Description.Assessment.Metadata.Status", @@ -87968,6 +89108,7 @@ var getAuditManagerAssessmentFilters = map[string]string{ "id": "Description.Assessment.Metadata.Id", "last_updated": "Description.Assessment.Metadata.LastUpdated", "name": "Description.Assessment.Metadata.Name", + "og_account_id": "metadata.IntegrationID", "roles": "Description.Assessment.Metadata.Roles", "scope": "Description.Assessment.Metadata.Scope", "status": "Description.Assessment.Metadata.Status", @@ -88036,6 +89177,7 @@ type AuditManagerControl struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AuditManagerControlDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -88122,6 +89264,7 @@ var listAuditManagerControlFilters = map[string]string{ "last_updated_at": "Description.Control.LastUpdatedAt", "last_updated_by": "Description.Control.LastUpdatedBy", "name": "Description.Control.Name", + "og_account_id": "metadata.IntegrationID", "tags": "Description.Control.Tags", "testing_information": "Description.Control.TestingInformation", "title": "Description.Control.Name", @@ -88202,6 +89345,7 @@ var getAuditManagerControlFilters = map[string]string{ "last_updated_at": "Description.Control.LastUpdatedAt", "last_updated_by": "Description.Control.LastUpdatedBy", "name": "Description.Control.Name", + "og_account_id": "metadata.IntegrationID", "tags": "Description.Control.Tags", "testing_information": "Description.Control.TestingInformation", "title": "Description.Control.Name", @@ -88269,6 +89413,7 @@ type AuditManagerEvidence struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AuditManagerEvidenceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -88358,6 +89503,7 @@ var listAuditManagerEvidenceFilters = map[string]string{ "evidence_folder_id": "Description.Evidence.EvidenceFolderId", "iam_id": "Description.Evidence.IamId", "id": "Description.Evidence.Id", + "og_account_id": "metadata.IntegrationID", "resources_included": "Description.Evidence.ResourcesIncluded", "time": "Description.Evidence.Time", "title": "Description.Evidence.Id", @@ -88439,6 +89585,7 @@ var getAuditManagerEvidenceFilters = map[string]string{ "evidence_folder_id": "description.Evidence.EvidenceFolderId", "iam_id": "Description.Evidence.IamId", "id": "description.Evidence.Id", + "og_account_id": "metadata.IntegrationID", "resources_included": "Description.Evidence.ResourcesIncluded", "time": "Description.Evidence.Time", "title": "Description.Evidence.Id", @@ -88505,6 +89652,7 @@ type AuditManagerEvidenceFolder struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AuditManagerEvidenceFolderDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -88596,6 +89744,7 @@ var listAuditManagerEvidenceFolderFilters = map[string]string{ "evidence_resources_included_count": "Description.EvidenceFolder.EvidenceResourcesIncludedCount", "id": "Description.EvidenceFolder.Id", "name": "Description.EvidenceFolder.Name", + "og_account_id": "metadata.IntegrationID", "title": "Description.EvidenceFolder.Name", "total_evidence": "Description.EvidenceFolder.TotalEvidence", } @@ -88678,6 +89827,7 @@ var getAuditManagerEvidenceFolderFilters = map[string]string{ "evidence_resources_included_count": "Description.EvidenceFolder.EvidenceResourcesIncludedCount", "id": "description.EvidenceFolder.Id", "name": "Description.EvidenceFolder.Name", + "og_account_id": "metadata.IntegrationID", "title": "Description.EvidenceFolder.Name", "total_evidence": "Description.EvidenceFolder.TotalEvidence", } @@ -88743,6 +89893,7 @@ type AuditManagerFramework struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.AuditManagerFrameworkDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -88831,6 +89982,7 @@ var listAuditManagerFrameworkFilters = map[string]string{ "last_updated_by": "Description.Framework.LastUpdatedBy", "logo": "Description.Framework.Logo", "name": "Description.Framework.Name", + "og_account_id": "metadata.IntegrationID", "tags": "Description.Framework.Tags", "title": "Description.Framework.Name", "type": "Description.Framework.Type", @@ -88911,6 +90063,7 @@ var getAuditManagerFrameworkFilters = map[string]string{ "last_updated_by": "Description.Framework.LastUpdatedBy", "logo": "Description.Framework.Logo", "name": "Description.Framework.Name", + "og_account_id": "metadata.IntegrationID", "region": "metadata.Region", "tags": "Description.Framework.Tags", "title": "Description.Framework.Name", @@ -88978,6 +90131,7 @@ type CloudSearchDomain struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.CloudSearchDomainDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -89058,6 +90212,7 @@ var listCloudSearchDomainFilters = map[string]string{ "domain_id": "Description.DomainStatus.DomainId", "domain_name": "Description.DomainStatus.DomainName", "limits": "Description.DomainStatus.Limits", + "og_account_id": "metadata.IntegrationID", "processing": "Description.DomainStatus.Processing", "requires_index_documents": "Description.DomainStatus.RequiresIndexDocuments", "search_instance_count": "Description.DomainStatus.SearchInstanceCount", @@ -89134,6 +90289,7 @@ var getCloudSearchDomainFilters = map[string]string{ "domain_id": "Description.DomainStatus.DomainId", "domain_name": "description.DomainStatus.DomainName", "limits": "Description.DomainStatus.Limits", + "og_account_id": "metadata.IntegrationID", "processing": "Description.DomainStatus.Processing", "requires_index_documents": "Description.DomainStatus.RequiresIndexDocuments", "search_instance_count": "Description.DomainStatus.SearchInstanceCount", @@ -89204,6 +90360,7 @@ type DLMLifecyclePolicy struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DLMLifecyclePolicyDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -89283,6 +90440,7 @@ var listDLMLifecyclePolicyFilters = map[string]string{ "date_modified": "Description.LifecyclePolicy.DateModified", "description": "Description.LifecyclePolicy.Description", "execution_role_arn": "Description.LifecyclePolicy.ExecutionRoleArn", + "og_account_id": "metadata.IntegrationID", "policy_details": "Description.LifecyclePolicy.PolicyDetails", "policy_id": "Description.LifecyclePolicy.PolicyId", "policy_type": "Description.LifecyclePolicy.PolicyDetails.PolicyType", @@ -89359,6 +90517,7 @@ var getDLMLifecyclePolicyFilters = map[string]string{ "description": "Description.LifecyclePolicy.Description", "execution_role_arn": "Description.LifecyclePolicy.ExecutionRoleArn", "id": "description.LifecyclePolicy.PolicyId", + "og_account_id": "metadata.IntegrationID", "policy_details": "Description.LifecyclePolicy.PolicyDetails", "policy_id": "Description.LifecyclePolicy.PolicyId", "policy_type": "Description.LifecyclePolicy.PolicyDetails.PolicyType", @@ -89429,6 +90588,7 @@ type DocDBCluster struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DocDBClusterDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -89525,6 +90685,7 @@ var listDocDBClusterFilters = map[string]string{ "master_user_name": "Description.DBCluster.MasterUsername", "members": "Description.DBCluster.DBClusterMembers", "multi_az": "Description.DBCluster.MultiAZ", + "og_account_id": "metadata.IntegrationID", "percent_progress": "Description.DBCluster.PercentProgress", "port": "Description.DBCluster.Port", "preferred_backup_window": "Description.DBCluster.PreferredBackupWindow", @@ -89622,6 +90783,7 @@ var getDocDBClusterFilters = map[string]string{ "master_user_name": "Description.DBCluster.MasterUsername", "members": "Description.DBCluster.DBClusterMembers", "multi_az": "Description.DBCluster.MultiAZ", + "og_account_id": "metadata.IntegrationID", "percent_progress": "Description.DBCluster.PercentProgress", "port": "Description.DBCluster.Port", "preferred_backup_window": "Description.DBCluster.PreferredBackupWindow", @@ -89697,6 +90859,7 @@ type DocDBClusterInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DocDBClusterInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -89794,6 +90957,7 @@ var listDocDBClusterInstanceFilters = map[string]string{ "instance_create_time": "Description.DBInstance.InstanceCreateTime", "kms_key_id": "Description.DBInstance.KmsKeyId", "latest_restorable_time": "Description.DBInstance.LatestRestorableTime", + "og_account_id": "metadata.IntegrationID", "pending_modified_values": "Description.DBInstance.PendingModifiedValues", "preferred_backup_window": "Description.DBInstance.PreferredBackupWindow", "preferred_maintenance_window": "Description.DBInstance.PreferredMaintenanceWindow", @@ -89892,6 +91056,7 @@ var getDocDBClusterInstanceFilters = map[string]string{ "instance_create_time": "Description.DBInstance.InstanceCreateTime", "kms_key_id": "Description.DBInstance.KmsKeyId", "latest_restorable_time": "Description.DBInstance.LatestRestorableTime", + "og_account_id": "metadata.IntegrationID", "pending_modified_values": "Description.DBInstance.PendingModifiedValues", "preferred_backup_window": "Description.DBInstance.PreferredBackupWindow", "preferred_maintenance_window": "Description.DBInstance.PreferredMaintenanceWindow", @@ -89967,6 +91132,7 @@ type DocDBClusterSnapshot struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.DocDBClusterSnapshotDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -90207,6 +91373,7 @@ type GlobalAcceleratorAccelerator struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlobalAcceleratorAcceleratorDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -90290,6 +91457,7 @@ var listGlobalAcceleratorAcceleratorFilters = map[string]string{ "ip_sets": "Description.Accelerator.IpSets", "last_modified_time": "Description.Accelerator.LastModifiedTime", "name": "Description.Accelerator.Name", + "og_account_id": "metadata.IntegrationID", "status": "Description.Accelerator.Status", "tags_src": "Description.Tags", "title": "Description.Accelerator.Name", @@ -90365,6 +91533,7 @@ var getGlobalAcceleratorAcceleratorFilters = map[string]string{ "ip_sets": "Description.Accelerator.IpSets", "last_modified_time": "Description.Accelerator.LastModifiedTime", "name": "Description.Accelerator.Name", + "og_account_id": "metadata.IntegrationID", "status": "Description.Accelerator.Status", "tags_src": "Description.Tags", "title": "Description.Accelerator.Name", @@ -90431,6 +91600,7 @@ type GlobalAcceleratorEndpointGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlobalAcceleratorEndpointGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -90513,6 +91683,7 @@ var listGlobalAcceleratorEndpointGroupFilters = map[string]string{ "health_check_port": "Description.EndpointGroup.HealthCheckPort", "health_check_protocol": "Description.EndpointGroup.HealthCheckProtocol", "listener_arn": "description.ListenerArn", + "og_account_id": "metadata.IntegrationID", "port_overrides": "Description.EndpointGroup.PortOverrides", "threshold_count": "Description.EndpointGroup.ThresholdCount", "traffic_dial_percentage": "Description.EndpointGroup.TrafficDialPercentage", @@ -90587,6 +91758,7 @@ var getGlobalAcceleratorEndpointGroupFilters = map[string]string{ "health_check_port": "Description.EndpointGroup.HealthCheckPort", "health_check_protocol": "Description.EndpointGroup.HealthCheckProtocol", "listener_arn": "Description.ListenerArn", + "og_account_id": "metadata.IntegrationID", "port_overrides": "Description.EndpointGroup.PortOverrides", "threshold_count": "Description.EndpointGroup.ThresholdCount", "traffic_dial_percentage": "Description.EndpointGroup.TrafficDialPercentage", @@ -90653,6 +91825,7 @@ type GlobalAcceleratorListener struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlobalAcceleratorListenerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -90730,6 +91903,7 @@ var listGlobalAcceleratorListenerFilters = map[string]string{ "accelerator_arn": "description.AcceleratorArn", "arn": "Description.Listener.ListenerArn", "client_affinity": "Description.Listener.ClientAffinity", + "og_account_id": "metadata.IntegrationID", "port_ranges": "Description.Listener.PortRanges", "protocol": "Description.Listener.Protocol", } @@ -90798,6 +91972,7 @@ var getGlobalAcceleratorListenerFilters = map[string]string{ "accelerator_arn": "Description.AcceleratorArn", "arn": "description.Listener.ListenerArn", "client_affinity": "Description.Listener.ClientAffinity", + "og_account_id": "metadata.IntegrationID", "port_ranges": "Description.Listener.PortRanges", "protocol": "Description.Listener.Protocol", } @@ -90863,6 +92038,7 @@ type GlueCatalogDatabase struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueCatalogDatabaseDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -90943,6 +92119,7 @@ var listGlueCatalogDatabaseFilters = map[string]string{ "description": "Description.Database.Description", "location_uri": "Description.Database.LocationUri", "name": "Description.Database.Name", + "og_account_id": "metadata.IntegrationID", "parameters": "Description.Database.Parameters", "target_database": "Description.Database.TargetDatabase", "title": "Description.Database.Name", @@ -91015,6 +92192,7 @@ var getGlueCatalogDatabaseFilters = map[string]string{ "description": "Description.Database.Description", "location_uri": "Description.Database.LocationUri", "name": "description.Database.Name", + "og_account_id": "metadata.IntegrationID", "parameters": "Description.Database.Parameters", "target_database": "Description.Database.TargetDatabase", "title": "Description.Database.Name", @@ -91081,6 +92259,7 @@ type GlueCatalogTable struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueCatalogTableDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -91165,6 +92344,7 @@ var listGlueCatalogTableFilters = map[string]string{ "last_analyzed_time": "Description.Table.LastAnalyzedTime", "lf_tags": "Description.LfTags", "name": "Description.Table.Name", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Table.Owner", "parameters": "Description.Table.Parameters", "partition_keys": "Description.Table.PartitionKeys", @@ -91249,6 +92429,7 @@ var getGlueCatalogTableFilters = map[string]string{ "last_analyzed_time": "Description.Table.LastAnalyzedTime", "lf_tags": "Description.LfTags", "name": "description.Table.Name", + "og_account_id": "metadata.IntegrationID", "owner": "Description.Table.Owner", "parameters": "Description.Table.Parameters", "partition_keys": "Description.Table.PartitionKeys", @@ -91323,6 +92504,7 @@ type GlueConnection struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueConnectionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -91405,6 +92587,7 @@ var listGlueConnectionFilters = map[string]string{ "last_updated_time": "Description.Connection.LastUpdatedTime", "match_criteria": "Description.Connection.MatchCriteria", "name": "Description.Connection.Name", + "og_account_id": "metadata.IntegrationID", "physical_connection_requirements": "Description.Connection.PhysicalConnectionRequirements", "title": "Description.Connection.Name", } @@ -91478,6 +92661,7 @@ var getGlueConnectionFilters = map[string]string{ "last_updated_time": "Description.Connection.LastUpdatedTime", "match_criteria": "Description.Connection.MatchCriteria", "name": "description.Connection.Name", + "og_account_id": "metadata.IntegrationID", "physical_connection_requirements": "Description.Connection.PhysicalConnectionRequirements", "title": "Description.Connection.Name", } @@ -91543,6 +92727,7 @@ type GlueCrawler struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueCrawlerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -91628,6 +92813,7 @@ var listGlueCrawlerFilters = map[string]string{ "last_crawl": "Description.Crawler.LastCrawl", "last_updated": "Description.Crawler.LastUpdated", "name": "Description.Crawler.Name", + "og_account_id": "metadata.IntegrationID", "recrawl_behavior": "Description.Crawler.RecrawlPolicy.RecrawlBehavior", "role": "Description.Crawler.Role", "schedule": "Description.Crawler.Schedule", @@ -91711,6 +92897,7 @@ var getGlueCrawlerFilters = map[string]string{ "last_crawl": "Description.Crawler.LastCrawl", "last_updated": "Description.Crawler.LastUpdated", "name": "description.Crawler.Name", + "og_account_id": "metadata.IntegrationID", "recrawl_behavior": "Description.Crawler.RecrawlPolicy.RecrawlBehavior", "role": "Description.Crawler.Role", "schedule": "Description.Crawler.Schedule", @@ -91783,6 +92970,7 @@ type GlueDataCatalogEncryptionSettings struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueDataCatalogEncryptionSettingsDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -91859,6 +93047,7 @@ func (p GlueDataCatalogEncryptionSettingsPaginator) NextPage(ctx context.Context var listGlueDataCatalogEncryptionSettingsFilters = map[string]string{ "connection_password_encryption": "Description.DataCatalogEncryptionSettings.ConnectionPasswordEncryption", "encryption_at_rest": "Description.DataCatalogEncryptionSettings.EncryptionAtRest", + "og_account_id": "metadata.IntegrationID", } func ListGlueDataCatalogEncryptionSettings(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -91924,6 +93113,7 @@ func ListGlueDataCatalogEncryptionSettings(ctx context.Context, d *plugin.QueryD var getGlueDataCatalogEncryptionSettingsFilters = map[string]string{ "connection_password_encryption": "Description.DataCatalogEncryptionSettings.ConnectionPasswordEncryption", "encryption_at_rest": "Description.DataCatalogEncryptionSettings.EncryptionAtRest", + "og_account_id": "metadata.IntegrationID", } func GetGlueDataCatalogEncryptionSettings(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { @@ -91987,6 +93177,7 @@ type GlueDataQualityRuleset struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueDataQualityRulesetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -92066,6 +93257,7 @@ var listGlueDataQualityRulesetFilters = map[string]string{ "description": "Description.DataQualityRuleset.Description", "last_modified_on": "description.DataQualityRuleset.LastModifiedOn", "name": "Description.DataQualityRuleset.Name", + "og_account_id": "metadata.IntegrationID", "recommendation_run_id": "Description.DataQualityRuleset.RecommendationRunId", "rule_count": "Description.RulesetRuleCount", "rule_set": "Description.DataQualityRuleset.Ruleset", @@ -92140,6 +93332,7 @@ var getGlueDataQualityRulesetFilters = map[string]string{ "description": "Description.DataQualityRuleset.Description", "last_modified_on": "Description.DataQualityRuleset.LastModifiedOn", "name": "description.DataQualityRuleset.Name", + "og_account_id": "metadata.IntegrationID", "recommendation_run_id": "Description.DataQualityRuleset.RecommendationRunId", "rule_count": "Description.RulesetRuleCount", "rule_set": "Description.DataQualityRuleset.Ruleset", @@ -92209,6 +93402,7 @@ type GlueDevEndpoint struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueDevEndpointDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -92294,6 +93488,7 @@ var listGlueDevEndpointFilters = map[string]string{ "last_update_status": "Description.DevEndpoint.LastUpdateStatus", "number_of_nodes": "Description.DevEndpoint.NumberOfNodes", "number_of_workers": "Description.DevEndpoint.NumberOfWorkers", + "og_account_id": "metadata.IntegrationID", "private_address": "Description.DevEndpoint.PrivateAddress", "public_address": "Description.DevEndpoint.PublicAddress", "public_key": "Description.DevEndpoint.PublicKey", @@ -92382,6 +93577,7 @@ var getGlueDevEndpointFilters = map[string]string{ "last_update_status": "Description.DevEndpoint.LastUpdateStatus", "number_of_nodes": "Description.DevEndpoint.NumberOfNodes", "number_of_workers": "Description.DevEndpoint.NumberOfWorkers", + "og_account_id": "metadata.IntegrationID", "private_address": "Description.DevEndpoint.PrivateAddress", "public_address": "Description.DevEndpoint.PublicAddress", "public_key": "Description.DevEndpoint.PublicKey", @@ -92459,6 +93655,7 @@ type GlueJob struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueJobDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -92550,6 +93747,7 @@ var listGlueJobFilters = map[string]string{ "non_overridable_arguments": "Description.Job.NonOverridableArguments", "notification_property": "Description.Job.NotificationProperty", "number_of_workers": "Description.Job.NumberOfWorkers", + "og_account_id": "metadata.IntegrationID", "role": "Description.Job.Role", "security_configuration": "Description.Job.SecurityConfiguration", "timeout": "Description.Job.Timeout", @@ -92635,6 +93833,7 @@ var getGlueJobFilters = map[string]string{ "non_overridable_arguments": "Description.Job.NonOverridableArguments", "notification_property": "Description.Job.NotificationProperty", "number_of_workers": "Description.Job.NumberOfWorkers", + "og_account_id": "metadata.IntegrationID", "role": "Description.Job.Role", "security_configuration": "Description.Job.SecurityConfiguration", "timeout": "Description.Job.Timeout", @@ -92703,6 +93902,7 @@ type GlueSecurityConfiguration struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.GlueSecurityConfigurationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -92781,6 +93981,7 @@ var listGlueSecurityConfigurationFilters = map[string]string{ "created_time_stamp": "Description.SecurityConfiguration.CreatedTimeStamp", "job_bookmarks_encryption": "Description.SecurityConfiguration.EncryptionConfiguration.JobBookmarksEncryption", "name": "Description.SecurityConfiguration.Name", + "og_account_id": "metadata.IntegrationID", "s3_encryption": "Description.SecurityConfiguration.EncryptionConfiguration.S3Encryption", "title": "Description.SecurityConfiguration.Name", } @@ -92850,6 +94051,7 @@ var getGlueSecurityConfigurationFilters = map[string]string{ "created_time_stamp": "Description.SecurityConfiguration.CreatedTimeStamp", "job_bookmarks_encryption": "Description.SecurityConfiguration.EncryptionConfiguration.JobBookmarksEncryption", "name": "description.SecurityConfiguration.Name", + "og_account_id": "metadata.IntegrationID", "s3_encryption": "Description.SecurityConfiguration.EncryptionConfiguration.S3Encryption", "title": "Description.SecurityConfiguration.Name", } @@ -92915,6 +94117,7 @@ type HealthEvent struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.HealthEventDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -92996,6 +94199,7 @@ var listHealthEventFilters = map[string]string{ "event_type_category": "description.Event.EventTypeCategory", "event_type_code": "description.Event.EventTypeCode", "last_updated_time": "description.Event.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "service": "description.Event.Service", "start_time": "description.Event.StartTime", "status_code": "description.Event.StatusCode", @@ -93069,6 +94273,7 @@ var getHealthEventFilters = map[string]string{ "event_type_category": "Description.Event.EventTypeCategory", "event_type_code": "Description.Event.EventTypeCode", "last_updated_time": "Description.Event.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "service": "Description.Event.Service", "start_time": "Description.Event.StartTime", "status_code": "Description.Event.StatusCode", @@ -93135,6 +94340,7 @@ type HealthAffectedEntity struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.HealthAffectedEntityDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -93214,6 +94420,7 @@ var listHealthAffectedEntityFilters = map[string]string{ "entity_value": "Description.Entity.EntityValue", "event_arn": "Description.Entity.EntityArn", "last_updated_time": "Description.Entity.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "status_code": "Description.Entity.StatusCode", "tags": "Description.Entity.Tags", } @@ -93284,6 +94491,7 @@ var getHealthAffectedEntityFilters = map[string]string{ "entity_value": "Description.Entity.EntityValue", "event_arn": "Description.Entity.EntityArn", "last_updated_time": "Description.Entity.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "status_code": "Description.Entity.StatusCode", "tags": "Description.Entity.Tags", } @@ -93349,6 +94557,7 @@ type IdentityStoreGroup struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IdentityStoreGroupDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -93427,6 +94636,7 @@ var listIdentityStoreGroupFilters = map[string]string{ "id": "Description.Group.GroupId", "identity_store_id": "description.Group.IdentityStoreId", "name": "Description.Group.DisplayName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Group.DisplayName", } @@ -93495,6 +94705,7 @@ var getIdentityStoreGroupFilters = map[string]string{ "id": "description.Group.GroupId", "identity_store_id": "description.Group.IdentityStoreId", "name": "Description.Group.DisplayName", + "og_account_id": "metadata.IntegrationID", "title": "Description.Group.DisplayName", } @@ -93559,6 +94770,7 @@ type IdentityStoreUser struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IdentityStoreUserDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -93638,6 +94850,7 @@ var listIdentityStoreUserFilters = map[string]string{ "id": "Description.User.UserId", "identity_store_id": "description.User.IdentityStoreId", "name": "Description.User.DisplayName", + "og_account_id": "metadata.IntegrationID", "title": "Description.User.Title", "user_name": "Description.User.UserName", } @@ -93708,6 +94921,7 @@ var getIdentityStoreUserFilters = map[string]string{ "id": "description.User.UserId", "identity_store_id": "description.User.IdentityStoreId", "name": "Description.User.DisplayName", + "og_account_id": "metadata.IntegrationID", "title": "Description.User.Title", "user_name": "Description.User.UserName", } @@ -93773,6 +94987,7 @@ type IdentityStoreGroupMembership struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.IdentityStoreGroupMembershipDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -93851,6 +95066,7 @@ var listIdentityStoreGroupMembershipFilters = map[string]string{ "identity_store_id": "description.Group.IdentityStoreId", "member_id": "Description.MemberId.Value", "membership_id": "Description.MembershipId", + "og_account_id": "metadata.IntegrationID", "title": "Description.MembershipId", } @@ -93920,6 +95136,7 @@ var getIdentityStoreGroupMembershipFilters = map[string]string{ "identity_store_id": "description.Group.IdentityStoreId", "member_id": "Description.MemberId.Value", "membership_id": "Description.MembershipId", + "og_account_id": "metadata.IntegrationID", "title": "Description.MembershipId", } @@ -93984,6 +95201,7 @@ type InspectorAssessmentRun struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.InspectorAssessmentRunDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -94067,6 +95285,7 @@ var listInspectorAssessmentRunFilters = map[string]string{ "finding_counts": "Description.AssessmentRun.FindingCounts", "name": "description.AssessmentRun.Name", "notifications": "Description.AssessmentRun.Notifications", + "og_account_id": "metadata.IntegrationID", "rules_package_arns": "Description.AssessmentRun.RulesPackageArns", "started_at": "Description.AssessmentRun.StartedAt", "state": "description.AssessmentRun.State", @@ -94146,6 +95365,7 @@ var getInspectorAssessmentRunFilters = map[string]string{ "finding_counts": "Description.AssessmentRun.FindingCounts", "name": "Description.AssessmentRun.Name", "notifications": "Description.AssessmentRun.Notifications", + "og_account_id": "metadata.IntegrationID", "rules_package_arns": "Description.AssessmentRun.RulesPackageArns", "started_at": "Description.AssessmentRun.StartedAt", "state": "Description.AssessmentRun.State", @@ -94216,6 +95436,7 @@ type InspectorAssessmentTarget struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.InspectorAssessmentTargetDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -94293,6 +95514,7 @@ var listInspectorAssessmentTargetFilters = map[string]string{ "arn": "Description.AssessmentTarget.Arn", "created_at": "Description.AssessmentTarget.CreatedAt", "name": "Description.AssessmentTarget.Name", + "og_account_id": "metadata.IntegrationID", "resource_group_arn": "Description.AssessmentTarget.ResourceGroupArn", "title": "Description.AssessmentTarget.Name", "updated_at": "Description.AssessmentTarget.UpdatedAt", @@ -94362,6 +95584,7 @@ var getInspectorAssessmentTargetFilters = map[string]string{ "arn": "description.AssessmentTarget.Arn", "created_at": "Description.AssessmentTarget.CreatedAt", "name": "Description.AssessmentTarget.Name", + "og_account_id": "metadata.IntegrationID", "resource_group_arn": "Description.AssessmentTarget.ResourceGroupArn", "title": "Description.AssessmentTarget.Name", "updated_at": "Description.AssessmentTarget.UpdatedAt", @@ -94428,6 +95651,7 @@ type InspectorAssessmentTemplate struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.InspectorAssessmentTemplateDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -94510,6 +95734,7 @@ var listInspectorAssessmentTemplateFilters = map[string]string{ "event_subscriptions": "Description.EventSubscriptions", "last_assessment_run_arn": "Description.AssessmentTemplate.LastAssessmentRunArn", "name": "description.AssessmentTemplate.Name", + "og_account_id": "metadata.IntegrationID", "rules_package_arns": "Description.AssessmentTemplate.RulesPackageArns", "tags_src": "Description.Tags", "title": "Description.AssessmentTemplate.Name", @@ -94585,6 +95810,7 @@ var getInspectorAssessmentTemplateFilters = map[string]string{ "event_subscriptions": "Description.EventSubscriptions", "last_assessment_run_arn": "Description.AssessmentTemplate.LastAssessmentRunArn", "name": "Description.AssessmentTemplate.Name", + "og_account_id": "metadata.IntegrationID", "rules_package_arns": "Description.AssessmentTemplate.RulesPackageArns", "tags_src": "Description.Tags", "title": "Description.AssessmentTemplate.Name", @@ -94652,6 +95878,7 @@ type InspectorExclusion struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.InspectorExclusionDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -94730,6 +95957,7 @@ var listInspectorExclusionFilters = map[string]string{ "assessment_run_arn": "description.Exclusion.Arn", "attributes": "Description.Exclusion.Attributes", "description": "Description.Exclusion.Description", + "og_account_id": "metadata.IntegrationID", "recommendation": "Description.Exclusion.Recommendation", "scopes": "Description.Exclusion.Scopes", "title": "Description.Exclusion.Title", @@ -94800,6 +96028,7 @@ var getInspectorExclusionFilters = map[string]string{ "assessment_run_arn": "Description.AssessmentRunArn", "attributes": "Description.Exclusion.Attributes", "description": "Description.Exclusion.Description", + "og_account_id": "metadata.IntegrationID", "recommendation": "Description.Exclusion.Recommendation", "scopes": "Description.Exclusion.Scopes", "title": "Description.Exclusion.Title", @@ -94866,6 +96095,7 @@ type InspectorFinding struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.InspectorFindingDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -94953,6 +96183,7 @@ var listInspectorFindingFilters = map[string]string{ "id": "Description.Finding.Id", "indicator_of_compromise": "Description.Finding.IndicatorOfCompromise", "numeric_severity": "Description.Finding.NumericSeverity", + "og_account_id": "metadata.IntegrationID", "recommendation": "Description.Finding.Recommendation", "schema_version": "Description.Finding.SchemaVersion", "service": "Description.Finding.Service", @@ -95037,6 +96268,7 @@ var getInspectorFindingFilters = map[string]string{ "id": "Description.Finding.Id", "indicator_of_compromise": "Description.Finding.IndicatorOfCompromise", "numeric_severity": "Description.Finding.NumericSeverity", + "og_account_id": "metadata.IntegrationID", "recommendation": "Description.Finding.Recommendation", "schema_version": "Description.Finding.SchemaVersion", "service": "Description.Finding.Service", @@ -95108,6 +96340,7 @@ type Inspector2Coverage struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Inspector2CoverageDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -95194,6 +96427,7 @@ var listInspector2CoverageFilters = map[string]string{ "lambda_function_name": "Description.CoveredResource.ResourceMetadata.LambdaFunction.FunctionName", "lambda_function_runtime": "Description.CoveredResource.ResourceMetadata.LambdaFunction.Runtime", "lambda_function_tags": "Description.CoveredResource.ResourceMetadata.LambdaFunction.FunctionTags", + "og_account_id": "metadata.IntegrationID", "resource_id": "Description.CoveredResource.ResourceId", "resource_type": "Description.CoveredResource.ResourceType", "scan_status_code": "Description.CoveredResource.ScanStatus.StatusCode", @@ -95274,6 +96508,7 @@ var getInspector2CoverageFilters = map[string]string{ "lambda_function_name": "Description.CoveredResource.ResourceMetadata.LambdaFunction.FunctionName", "lambda_function_runtime": "Description.CoveredResource.ResourceMetadata.LambdaFunction.Runtime", "lambda_function_tags": "Description.CoveredResource.ResourceMetadata.LambdaFunction.FunctionTags", + "og_account_id": "metadata.IntegrationID", "resource_id": "description.CoveredResource.ResourceId", "resource_type": "Description.CoveredResource.ResourceType", "scan_status_code": "Description.CoveredResource.ScanStatus.StatusCode", @@ -95343,6 +96578,7 @@ type Inspector2CoverageStatistic struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Inspector2CoverageStatisticDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -95418,6 +96654,7 @@ func (p Inspector2CoverageStatisticPaginator) NextPage(ctx context.Context) ([]I var listInspector2CoverageStatisticFilters = map[string]string{ "counts_by_group": "Description.Counts", + "og_account_id": "metadata.IntegrationID", "total_counts": "Description.TotalCounts", } @@ -95483,6 +96720,7 @@ func ListInspector2CoverageStatistic(ctx context.Context, d *plugin.QueryData, _ var getInspector2CoverageStatisticFilters = map[string]string{ "counts_by_group": "Description.Counts", + "og_account_id": "metadata.IntegrationID", "total_counts": "Description.TotalCounts", } @@ -95547,6 +96785,7 @@ type Inspector2Member struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Inspector2MemberDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -95623,6 +96862,7 @@ func (p Inspector2MemberPaginator) NextPage(ctx context.Context) ([]Inspector2Me var listInspector2MemberFilters = map[string]string{ "delegated_admin_account_id": "Description.Member.DelegatedAdminAccountId", "member_account_id": "Description.Member.AccountId", + "og_account_id": "metadata.IntegrationID", "relationship_status": "Description.Member.RelationshipStatus", "title": "Description.Member.AccountId", "updated_at": "Description.Member.UpdatedAt", @@ -95691,6 +96931,7 @@ func ListInspector2Member(ctx context.Context, d *plugin.QueryData, _ *plugin.Hy var getInspector2MemberFilters = map[string]string{ "delegated_admin_account_id": "Description.Member.DelegatedAdminAccountId", "member_account_id": "Description.Member.AccountId", + "og_account_id": "metadata.IntegrationID", "relationship_status": "Description.Member.RelationshipStatus", "title": "Description.Member.AccountId", "updated_at": "Description.Member.UpdatedAt", @@ -95757,6 +96998,7 @@ type Inspector2Finding struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Inspector2FindingDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -95857,6 +97099,7 @@ var listInspector2FindingFilters = map[string]string{ "last_observed_at": "Description.Finding.LastObservedAt", "network_protocol": "Description.Finding.NetworkReachabilityDetails.Protocol", "network_reachability_details": "Description.Finding.NetworkReachabilityDetails", + "og_account_id": "metadata.IntegrationID", "package_vulnerability_details": "Description.Finding.PackageVulnerabilityDetails", "reference_urls": "Description.Finding.PackageVulnerabilityDetails.ReferenceUrls", "related_vulnerabilitie": "Description.Finding.PackageVulnerabilityDetails.VulnerabilityId", @@ -95969,6 +97212,7 @@ var getInspector2FindingFilters = map[string]string{ "last_observed_at": "Description.Finding.LastObservedAt", "network_protocol": "Description.Finding.NetworkReachabilityDetails.Protocol", "network_reachability_details": "Description.Finding.NetworkReachabilityDetails", + "og_account_id": "metadata.IntegrationID", "package_vulnerability_details": "Description.Finding.PackageVulnerabilityDetails", "reference_urls": "Description.Finding.PackageVulnerabilityDetails.ReferenceUrls", "related_vulnerabilitie": "Description.Finding.PackageVulnerabilityDetails.VulnerabilityId", @@ -96055,6 +97299,7 @@ type FirehoseDeliveryStream struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.FirehoseDeliveryStreamDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -96139,6 +97384,7 @@ var listFirehoseDeliveryStreamFilters = map[string]string{ "failure_description": "Description.DeliveryStream.FailureDescription", "has_more_destinations": "Description.DeliveryStream.HasMoreDestinations", "last_update_timestamp": "Description.DeliveryStream.LastUpdateTimestamp", + "og_account_id": "metadata.IntegrationID", "source": "Description.DeliveryStream.Source", "tags_src": "Description.Tags", "title": "Description.DeliveryStream.DeliveryStreamName", @@ -96216,6 +97462,7 @@ var getFirehoseDeliveryStreamFilters = map[string]string{ "failure_description": "Description.DeliveryStream.FailureDescription", "has_more_destinations": "Description.DeliveryStream.HasMoreDestinations", "last_update_timestamp": "Description.DeliveryStream.LastUpdateTimestamp", + "og_account_id": "metadata.IntegrationID", "source": "Description.DeliveryStream.Source", "tags_src": "Description.Tags", "title": "Description.DeliveryStream.DeliveryStreamName", @@ -96283,6 +97530,7 @@ type LightsailInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.LightsailInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -96370,6 +97618,7 @@ var listLightsailInstanceFilters = map[string]string{ "metadata_options": "Description.Instance.MetadataOptions", "name": "Description.Instance.Name", "networking": "Description.Instance.Networking", + "og_account_id": "metadata.IntegrationID", "private_ip_address": "Description.Instance.PrivateIpAddress", "public_ip_address": "Description.Instance.PublicIpAddress", "resource_type": "Description.Instance.ResourceType", @@ -96456,6 +97705,7 @@ var getLightsailInstanceFilters = map[string]string{ "metadata_options": "Description.Instance.MetadataOptions", "name": "description.Instance.", "networking": "Description.Instance.Networking", + "og_account_id": "metadata.IntegrationID", "private_ip_address": "Description.Instance.PrivateIpAddress", "public_ip_address": "Description.Instance.PublicIpAddress", "resource_type": "Description.Instance.ResourceType", @@ -96529,6 +97779,7 @@ type Macie2ClassificationJob struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.Macie2ClassificationJobDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -96614,6 +97865,7 @@ var listMacie2ClassificationJobFilters = map[string]string{ "last_run_error_status": "Description.ClassificationJob.LastRunErrorStatus", "last_run_time": "Description.ClassificationJob.LastRunTime", "name": "description.ClassificationJob.Name", + "og_account_id": "metadata.IntegrationID", "s3_job_definition": "Description.ClassificationJob.S3JobDefinition", "sampling_percentage": "Description.ClassificationJob.SamplingPercentage", "schedule_frequency": "Description.ClassificationJob.ScheduleFrequency", @@ -96695,6 +97947,7 @@ var getMacie2ClassificationJobFilters = map[string]string{ "last_run_error_status": "Description.ClassificationJob.LastRunErrorStatus", "last_run_time": "Description.ClassificationJob.LastRunTime", "name": "Description.ClassificationJob.Name", + "og_account_id": "metadata.IntegrationID", "s3_job_definition": "Description.ClassificationJob.S3JobDefinition", "sampling_percentage": "Description.ClassificationJob.SamplingPercentage", "schedule_frequency": "Description.ClassificationJob.ScheduleFrequency", @@ -96765,6 +98018,7 @@ type MediaStoreContainer struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.MediaStoreContainerDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -96844,6 +98098,7 @@ var listMediaStoreContainerFilters = map[string]string{ "creation_time": "Description.Container.CreationTime", "endpoint": "Description.Container.Endpoint", "name": "Description.Container.Name", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "status": "Description.Container.Status", "tags_src": "Description.Tags", @@ -96916,6 +98171,7 @@ var getMediaStoreContainerFilters = map[string]string{ "creation_time": "Description.Container.CreationTime", "endpoint": "Description.Container.Endpoint", "name": "description.Container.Name", + "og_account_id": "metadata.IntegrationID", "policy": "Description.Policy", "status": "Description.Container.Status", "tags_src": "Description.Tags", @@ -96983,6 +98239,7 @@ type MgnApplication struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.MgnApplicationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -97065,6 +98322,7 @@ var listMgnApplicationFilters = map[string]string{ "is_archived": "description.Application.IsArchived", "last_modified_date_time": "Description.Application.LastModifiedDateTime", "name": "Description.Application.Name", + "og_account_id": "metadata.IntegrationID", "tags": "Description.Application.Tags", "title": "Description.Application.Name", "wave_id": "description.Application.WaveID", @@ -97139,6 +98397,7 @@ var getMgnApplicationFilters = map[string]string{ "is_archived": "Description.Application.IsArchived", "last_modified_date_time": "Description.Application.LastModifiedDateTime", "name": "Description.Application.Name", + "og_account_id": "metadata.IntegrationID", "tags": "Description.Application.Tags", "title": "Description.Application.Name", "wave_id": "Description.Application.WaveID", @@ -97205,6 +98464,7 @@ type SecurityLakeDataLake struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityLakeDataLakeDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -97283,6 +98543,7 @@ var listSecurityLakeDataLakeFilters = map[string]string{ "create_status": "Description.DataLake.CreateStatus", "kms_key_id": "Description.DataLake.EncryptionConfiguration.KmsKeyId", "lifecycle_configuration": "Description.DataLake.LifecycleConfiguration", + "og_account_id": "metadata.IntegrationID", "replication_configuration": "Description.DataLake.ReplicationConfiguration", "replication_role_arn": "Description.DataLake.ReplicationConfiguration.RoleArn", "s3_bucket_arn": "Description.DataLake.ReplicationConfiguration.S3BucketArn", @@ -97354,6 +98615,7 @@ var getSecurityLakeDataLakeFilters = map[string]string{ "create_status": "Description.DataLake.CreateStatus", "kms_key_id": "Description.DataLake.EncryptionConfiguration.KmsKeyId", "lifecycle_configuration": "Description.DataLake.LifecycleConfiguration", + "og_account_id": "metadata.IntegrationID", "replication_configuration": "Description.DataLake.ReplicationConfiguration", "replication_role_arn": "Description.DataLake.ReplicationConfiguration.RoleArn", "s3_bucket_arn": "Description.DataLake.ReplicationConfiguration.S3BucketArn", @@ -97421,6 +98683,7 @@ type SecurityLakeSubscriber struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.SecurityLakeSubscriberDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -97498,6 +98761,7 @@ var listSecurityLakeSubscriberFilters = map[string]string{ "access_types": "Description.Subscriber.AccessTypes", "created_at": "Description.Subscriber.CreatedAt", "external_id": "Description.Subscriber.ExternalId", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.Subscriber.RoleArn", "s3_bucket_arn": "Description.Subscriber.S3BucketArn", "sns_arn": "Description.Subscriber.SnsArn", @@ -97576,6 +98840,7 @@ var getSecurityLakeSubscriberFilters = map[string]string{ "access_types": "Description.Subscriber.AccessTypes", "created_at": "Description.Subscriber.CreatedAt", "external_id": "Description.Subscriber.ExternalId", + "og_account_id": "metadata.IntegrationID", "role_arn": "Description.Subscriber.RoleArn", "s3_bucket_arn": "Description.Subscriber.S3BucketArn", "sns_arn": "Description.Subscriber.SnsArn", @@ -97652,6 +98917,7 @@ type RamPrincipalAssociation struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RamPrincipalAssociationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -97731,6 +98997,7 @@ var listRamPrincipalAssociationFilters = map[string]string{ "creation_time": "Description.PrincipalAssociation.CreationTime", "external": "Description.PrincipalAssociation.External", "last_updated_time": "Description.PrincipalAssociation.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "resource_share_arn": "Description.PrincipalAssociation.ResourceShareArn", "resource_share_name": "Description.PrincipalAssociation.ResourceShareName", "resource_share_permission": "Description.ResourceSharePermission", @@ -97805,6 +99072,7 @@ var getRamPrincipalAssociationFilters = map[string]string{ "creation_time": "Description.PrincipalAssociation.CreationTime", "external": "Description.PrincipalAssociation.External", "last_updated_time": "Description.PrincipalAssociation.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "resource_share_arn": "Description.PrincipalAssociation.ResourceShareArn", "resource_share_name": "Description.PrincipalAssociation.ResourceShareName", "resource_share_permission": "Description.ResourceSharePermission", @@ -97874,6 +99142,7 @@ type RamResourceAssociation struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.RamResourceAssociationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -97953,6 +99222,7 @@ var listRamResourceAssociationFilters = map[string]string{ "creation_time": "Description.ResourceAssociation.CreationTime", "external": "Description.ResourceAssociation.External", "last_updated_time": "Description.ResourceAssociation.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "resource_share_arn": "Description.ResourceAssociation.ResourceShareArn", "resource_share_name": "Description.ResourceAssociation.ResourceShareName", "resource_share_permission": "Description.ResourceSharePermission", @@ -98027,6 +99297,7 @@ var getRamResourceAssociationFilters = map[string]string{ "creation_time": "Description.ResourceAssociation.CreationTime", "external": "Description.ResourceAssociation.External", "last_updated_time": "Description.ResourceAssociation.LastUpdatedTime", + "og_account_id": "metadata.IntegrationID", "resource_share_arn": "Description.ResourceAssociation.ResourceShareArn", "resource_share_name": "Description.ResourceAssociation.ResourceShareName", "resource_share_permission": "Description.ResourceSharePermission", @@ -98096,6 +99367,7 @@ type ServerlessApplicationRepositoryApplication struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ServerlessApplicationRepositoryApplicationDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -98179,6 +99451,7 @@ var listServerlessApplicationRepositoryApplicationFilters = map[string]string{ "labels": "Description.Application.Labels", "license_url": "Description.Application.LicenseUrl", "name": "Description.Application.Name", + "og_account_id": "metadata.IntegrationID", "readme_url": "Description.Application.ReadmeUrl", "spdx_license_id": "Description.Application.SpdxLicenseId", "statements": "Description.Statements", @@ -98257,6 +99530,7 @@ var getServerlessApplicationRepositoryApplicationFilters = map[string]string{ "labels": "Description.Application.Labels", "license_url": "Description.Application.LicenseUrl", "name": "Description.Application.Name", + "og_account_id": "metadata.IntegrationID", "readme_url": "Description.Application.ReadmeUrl", "spdx_license_id": "Description.Application.SpdxLicenseId", "statements": "Description.Statements", @@ -98326,6 +99600,7 @@ type ServiceQuotasServiceQuotaChangeRequest struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ServiceQuotasServiceQuotaChangeRequestDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -98406,6 +99681,7 @@ var listServiceQuotasServiceQuotaChangeRequestFilters = map[string]string{ "global_quota": "Description.ServiceQuotaChangeRequest.GlobalQuota", "id": "Description.ServiceQuotaChangeRequest.Id", "last_updated": "Description.ServiceQuotaChangeRequest.LastUpdated", + "og_account_id": "metadata.IntegrationID", "quota_arn": "Description.ServiceQuotaChangeRequest.QuotaArn", "quota_code": "Description.ServiceQuotaChangeRequest.QuotaCode", "quota_name": "Description.ServiceQuotaChangeRequest.QuotaName", @@ -98485,6 +99761,7 @@ var getServiceQuotasServiceQuotaChangeRequestFilters = map[string]string{ "global_quota": "Description.ServiceQuotaChangeRequest.GlobalQuota", "id": "description.ServiceQuotaChangeRequest.Id", "last_updated": "Description.ServiceQuotaChangeRequest.LastUpdated", + "og_account_id": "metadata.IntegrationID", "quota_arn": "Description.ServiceQuotaChangeRequest.QuotaArn", "quota_code": "Description.ServiceQuotaChangeRequest.QuotaCode", "quota_name": "Description.ServiceQuotaChangeRequest.QuotaName", @@ -98558,6 +99835,7 @@ type ServiceQuotasService struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ServiceQuotasServiceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -98764,6 +100042,7 @@ type ServiceCatalogProduct struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ServiceCatalogProductDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -98844,6 +100123,7 @@ var listServiceCatalogProductFilters = map[string]string{ "id": "Description.ProductViewSummary.Id", "launch_paths": "Description.LunchPaths", "name": "Description.ProductViewSummary.Name", + "og_account_id": "metadata.IntegrationID", "owner": "Description.ProductViewSummary.Owner", "product_id": "Description.ProductViewSummary.ProductId", "provisioning_artifacts": "Description.ProvisioningArtifacts", @@ -98922,6 +100202,7 @@ var getServiceCatalogProductFilters = map[string]string{ "id": "Description.ProductViewSummary.Id", "launch_paths": "Description.LunchPaths", "name": "Description.ProductViewSummary.Name", + "og_account_id": "metadata.IntegrationID", "owner": "Description.ProductViewSummary.Owner", "product_id": "Description.ProductViewSummary.ProductId", "provisioning_artifacts": "Description.ProvisioningArtifacts", @@ -98994,6 +100275,7 @@ type ServiceCatalogPortfolio struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ServiceCatalogPortfolioDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -99074,6 +100356,7 @@ var listServiceCatalogPortfolioFilters = map[string]string{ "description": "Description.Portfolio.Description", "display_name": "Description.Portfolio.DisplayName", "id": "Description.Portfolio.Id", + "og_account_id": "metadata.IntegrationID", "provider_name": "Description.Portfolio.ProviderName", "tag_options": "Description.TagOptions", "tags": "Description.Tag", @@ -99148,6 +100431,7 @@ var getServiceCatalogPortfolioFilters = map[string]string{ "description": "Description.Portfolio.Description", "display_name": "Description.Portfolio.DisplayName", "id": "Description.Portfolio.Id", + "og_account_id": "metadata.IntegrationID", "provider_name": "Description.Portfolio.ProviderName", "tag_options": "Description.TagOptions", "tags": "Description.Tag", @@ -99216,6 +100500,7 @@ type ServiceDiscoveryService struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ServiceDiscoveryServiceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -99300,6 +100585,7 @@ var listServiceDiscoveryServiceFilters = map[string]string{ "instance_count": "Description.Service.DnsConfig.InstanceCount", "name": "Description.Service.Name", "namespace_id": "Description.Service.DnsConfig.NamespaceId", + "og_account_id": "metadata.IntegrationID", "routing_policy": "Description.Service.DnsConfig.RoutingPolicy", "tags": "Description.Tags", "tags_src": "Description.Tags", @@ -99378,6 +100664,7 @@ var getServiceDiscoveryServiceFilters = map[string]string{ "instance_count": "Description.Service.DnsConfig.InstanceCount", "name": "Description.Service.Name", "namespace_id": "Description.Service.DnsConfig.NamespaceId", + "og_account_id": "metadata.IntegrationID", "routing_policy": "Description.Service.DnsConfig.RoutingPolicy", "tags": "Description.Tags", "tags_src": "Description.Tags", @@ -99446,6 +100733,7 @@ type ServiceDiscoveryNamespace struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ServiceDiscoveryNamespaceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -99527,6 +100815,7 @@ var listServiceDiscoveryNamespaceFilters = map[string]string{ "http_properties": "Description.Namespace.Properties.HttpProperties", "id": "Description.Namespace.Id", "name": "Description.Namespace.Name", + "og_account_id": "metadata.IntegrationID", "service_count": "Description.Namespace.ServiceCount", "tags": "Description.Tags", "tags_src": "Description.Tags", @@ -99602,6 +100891,7 @@ var getServiceDiscoveryNamespaceFilters = map[string]string{ "http_properties": "Description.Namespace.Properties.HttpProperties", "id": "Description.Namespace.Id", "name": "Description.Namespace.Name", + "og_account_id": "metadata.IntegrationID", "service_count": "Description.Namespace.ServiceCount", "tags": "Description.Tags", "tags_src": "Description.Tags", @@ -99670,6 +100960,7 @@ type ServiceDiscoveryInstance struct { ResourceID string `json:"resource_id"` PlatformID string `json:"platform_id"` Description aws.ServiceDiscoveryInstanceDescription `json:"description"` + Metadata aws.Metadata `json:"metadata"` DescribedBy int `json:"described_by"` ResourceType string `json:"resource_type"` IntegrationType string `json:"integration_type"` @@ -99753,6 +101044,7 @@ var listServiceDiscoveryInstanceFilters = map[string]string{ "instance_ipv4": "Description.Instance.Attributes.AWS_INSTANCE_IPV4", "instance_ipv6": "Description.Instance.Attributes.AWS_INSTANCE_IPV6", "instance_port": "Description.Instance.Attributes.AWS_INSTANCE_PORT", + "og_account_id": "metadata.IntegrationID", "service_id": "Description.ServiceId", "title": "Description.Instance.Id", } @@ -99827,6 +101119,7 @@ var getServiceDiscoveryInstanceFilters = map[string]string{ "instance_ipv4": "Description.Instance.Attributes.AWS_INSTANCE_IPV4", "instance_ipv6": "Description.Instance.Attributes.AWS_INSTANCE_IPV6", "instance_port": "Description.Instance.Attributes.AWS_INSTANCE_PORT", + "og_account_id": "metadata.IntegrationID", "service_id": "Description.ServiceId", "title": "Description.Instance.Id", } diff --git a/pkg/sdk/models/resource.go b/pkg/sdk/models/resource.go index 5ad8c636..1a8d090a 100644 --- a/pkg/sdk/models/resource.go +++ b/pkg/sdk/models/resource.go @@ -3,12 +3,18 @@ package models type StreamSender func(Resource) error type Resource struct { + // ARN uniquely identifies an AWS resource across regions, accounts and types. + ARN string + // ID doesn't uniquely identifies a resource. It will be used to create a + // unique identifier by concating PARTITION|REGION|ACCOUNT|TYPE|ID ID string Description interface{} - Name string - Type string - IntegrationMetadata interface{} + Name string + Account string + Region string + Partition string + Type string } func (r Resource) UniqueID() string { diff --git a/pkg/sdk/runable/steampipe_es_client_generator/main.go b/pkg/sdk/runable/steampipe_es_client_generator/main.go index e538932f..b70c01f2 100755 --- a/pkg/sdk/runable/steampipe_es_client_generator/main.go +++ b/pkg/sdk/runable/steampipe_es_client_generator/main.go @@ -82,6 +82,7 @@ type {{ .Name }} struct { ResourceID string ` + "`json:\"resource_id\"`" + ` PlatformID string ` + "`json:\"platform_id\"`" + ` Description {{ .IntegrationType }}.{{ .Name }}Description ` + "`json:\"description\"`" + ` + Metadata {{ .IntegrationType }}.Metadata ` + "`json:\"metadata\"`" + ` DescribedBy int ` + "`json:\"described_by\"`" + ` ResourceType string ` + "`json:\"resource_type\"`" + ` IntegrationType string ` + "`json:\"integration_type\"`" + ` @@ -383,6 +384,8 @@ func Get{{ .Name }}(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateD s.ListFilters[fparts[0]] = fparts[1] } } + s.GetFilters["og_account_id"] = "metadata.IntegrationID" + s.ListFilters["og_account_id"] = "metadata.IntegrationID" } if s.Index != "" { diff --git a/provider/credentials.go b/provider/credentials.go index cf4e3656..4fd3fee5 100755 --- a/provider/credentials.go +++ b/provider/credentials.go @@ -6,10 +6,12 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" + awsmodel "github.com/opengovern/og-aws-describer/aws/model" model "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/opengovern/og-describer-aws/provider/configs" "github.com/opengovern/og-util/pkg/describe" "golang.org/x/net/context" + "strings" ) // GenerateAWSConfig creates an AWS configuration using the provided credentials provider. @@ -56,7 +58,23 @@ func AccountCredentialsFromMap(m map[string]any) (configs.IntegrationCredentials // GetResourceMetadata TODO: Get metadata as a map to add to the resources func GetResourceMetadata(job describe.DescribeJob, resource model.Resource) (map[string]string, error) { metadata := make(map[string]string) + awsMetadata := awsmodel.Metadata{ + Name: resource.Name, + AccountID: job.IntegrationID, + SourceID: job.ProviderID, + Region: resource.Region, + ResourceType: strings.ToLower(job.ResourceType), + } + + awsMetadataBytes, err := json.Marshal(awsMetadata) + if err != nil { + return nil, fmt.Errorf("marshal metadata: %v", err.Error()) + } + err = json.Unmarshal(awsMetadataBytes, &metadata) + if err != nil { + return nil, fmt.Errorf("unmarshal metadata: %v", err.Error()) + } return metadata, nil } diff --git a/provider/describer/accessanalyzer.go b/provider/describer/accessanalyzer.go index 1f1e5851..08f56ccd 100755 --- a/provider/describer/accessanalyzer.go +++ b/provider/describer/accessanalyzer.go @@ -9,7 +9,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func GetAccessAnalyzerAnalyzer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAccessAnalyzerAnalyzer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) analyzerName := fields["name"] client := accessanalyzer.NewFromConfig(cfg) @@ -25,7 +25,7 @@ func GetAccessAnalyzerAnalyzer(ctx context.Context, cfg aws.Config, fields map[s return nil, err } - return []Resource{ + return []models.Resource{ { Region: describeCtx.OGRegion, ARN: *v.Analyzer.Arn, @@ -37,12 +37,12 @@ func GetAccessAnalyzerAnalyzer(ctx context.Context, cfg aws.Config, fields map[s }}, nil } -func AccessAnalyzerAnalyzer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AccessAnalyzerAnalyzer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := accessanalyzer.NewFromConfig(cfg) paginator := accessanalyzer.NewListAnalyzersPaginator(client, &accessanalyzer.ListAnalyzersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -54,7 +54,7 @@ func AccessAnalyzerAnalyzer(ctx context.Context, cfg aws.Config, stream *StreamS if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, @@ -96,12 +96,12 @@ func getAnalyzerFindings(ctx context.Context, client *accessanalyzer.Client, ana return findings, nil } -func AccessAnalyzerAnalyzerFinding(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AccessAnalyzerAnalyzerFinding(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := accessanalyzer.NewFromConfig(cfg) paginator := accessanalyzer.NewListAnalyzersPaginator(client, &accessanalyzer.ListAnalyzersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -114,7 +114,7 @@ func AccessAnalyzerAnalyzerFinding(ctx context.Context, cfg aws.Config, stream * return nil, err } for _, finding := range findings { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *finding.Id, Description: model.AccessAnalyzerAnalyzerFindingDescription{ diff --git a/provider/describer/account.go b/provider/describer/account.go index faaefa73..0d0193af 100755 --- a/provider/describer/account.go +++ b/provider/describer/account.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/account" @@ -9,10 +10,10 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func AccountAlternateContact(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AccountAlternateContact(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) - var values []Resource + var values []models.Resource contactTypes := []types.AlternateContactType{types.AlternateContactTypeBilling, types.AlternateContactTypeOperations, types.AlternateContactTypeSecurity} input := &account.GetAlternateContactInput{ @@ -24,7 +25,7 @@ func AccountAlternateContact(ctx context.Context, cfg aws.Config, stream *Stream if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -42,7 +43,7 @@ func AccountAlternateContact(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func accountAlternateContactHandle(ctx context.Context, cfg aws.Config, accountId string, contactType types.AlternateContactType) (Resource, error) { +func accountAlternateContactHandle(ctx context.Context, cfg aws.Config, accountId string, contactType types.AlternateContactType) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := account.NewFromConfig(cfg) @@ -54,10 +55,10 @@ func accountAlternateContactHandle(ctx context.Context, cfg aws.Config, accountI if isErr(err, "ResourceNotFoundException") { op = &account.GetAlternateContactOutput{} } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *op.AlternateContact.Name, Description: model.AccountAlternateContactDescription{ @@ -67,16 +68,16 @@ func accountAlternateContactHandle(ctx context.Context, cfg aws.Config, accountI } return resource, nil } -func GetAccountAlternateContact(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAccountAlternateContact(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { accountId := fields["accountId"] contactTypes := []types.AlternateContactType{types.AlternateContactTypeBilling, types.AlternateContactTypeOperations, types.AlternateContactTypeSecurity} - var values []Resource + var values []models.Resource for _, contactType := range contactTypes { resource, err := accountAlternateContactHandle(ctx, cfg, accountId, contactType) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -85,12 +86,12 @@ func GetAccountAlternateContact(ctx context.Context, cfg aws.Config, fields map[ return values, nil } -func AccountContact(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AccountContact(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := account.NewFromConfig(cfg) - var values []Resource + var values []models.Resource input := &account.GetContactInformationInput{} op, err := client.GetContactInformation(ctx, input) @@ -98,7 +99,7 @@ func AccountContact(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *op.ContactInformation.FullName, Description: model.AccountContactDescription{ diff --git a/provider/describer/acm.go b/provider/describer/acm.go index d4c1b47f..d1c0c266 100755 --- a/provider/describer/acm.go +++ b/provider/describer/acm.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/service/acmpca/types" @@ -12,7 +13,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func CertificateManagerAccount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CertificateManagerAccount(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := acm.NewFromConfig(cfg) output, err := client.GetAccountConfiguration(ctx, &acm.GetAccountConfigurationInput{}) @@ -20,7 +21,7 @@ func CertificateManagerAccount(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } - return []Resource{ + return []models.Resource{ { Region: describeCtx.OGRegion, // No ID or ARN. Per Account Configuration @@ -28,12 +29,12 @@ func CertificateManagerAccount(ctx context.Context, cfg aws.Config, stream *Stre }}, nil } -func CertificateManagerCertificate(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CertificateManagerCertificate(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := acm.NewFromConfig(cfg) paginator := acm.NewListCertificatesPaginator(client, &acm.ListCertificatesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -68,7 +69,7 @@ func CertificateManagerCertificate(ctx context.Context, cfg aws.Config, stream * return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.CertificateArn, Name: nameFromArn(*v.CertificateArn), @@ -99,11 +100,11 @@ func CertificateManagerCertificate(ctx context.Context, cfg aws.Config, stream * return values, nil } -func ACMPCACertificateAuthority(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ACMPCACertificateAuthority(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := acmpca.NewFromConfig(cfg) paginator := acmpca.NewListCertificateAuthoritiesPaginator(client, &acmpca.ListCertificateAuthoritiesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -115,7 +116,7 @@ func ACMPCACertificateAuthority(ctx context.Context, cfg aws.Config, stream *Str if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -134,7 +135,7 @@ func ACMPCACertificateAuthority(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func aCMPCACertificateAuthorityHandle(ctx context.Context, cfg aws.Config, v types.CertificateAuthority) (Resource, error) { +func aCMPCACertificateAuthorityHandle(ctx context.Context, cfg aws.Config, v types.CertificateAuthority) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := acmpca.NewFromConfig(cfg) tags, err := client.ListTags(ctx, &acmpca.ListTagsInput{ @@ -142,12 +143,12 @@ func aCMPCACertificateAuthorityHandle(ctx context.Context, cfg aws.Config, v typ }) if err != nil { if isErr(err, "ListTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: nameFromArn(*v.Arn), @@ -158,7 +159,7 @@ func aCMPCACertificateAuthorityHandle(ctx context.Context, cfg aws.Config, v typ } return resource, nil } -func GetACMPCACertificateAuthority(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetACMPCACertificateAuthority(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { certificateAuthorityArn := fields["arn"] client := acmpca.NewFromConfig(cfg) @@ -172,12 +173,12 @@ func GetACMPCACertificateAuthority(ctx context.Context, cfg aws.Config, fields m return nil, err } - var values []Resource + var values []models.Resource resource, err := aCMPCACertificateAuthorityHandle(ctx, cfg, *out.CertificateAuthority) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/amp.go b/provider/describer/amp.go index e5380531..16ffe79b 100755 --- a/provider/describer/amp.go +++ b/provider/describer/amp.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/service/amp/types" @@ -10,11 +11,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func AMPWorkspace(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AMPWorkspace(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := amp.NewFromConfig(cfg) paginator := amp.NewListWorkspacesPaginator(client, &.ListWorkspacesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -38,9 +39,9 @@ func AMPWorkspace(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func aMPWorkspaceHandle(ctx context.Context, v types.WorkspaceSummary) Resource { +func aMPWorkspaceHandle(ctx context.Context, v types.WorkspaceSummary) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.WorkspaceId, @@ -50,7 +51,7 @@ func aMPWorkspaceHandle(ctx context.Context, v types.WorkspaceSummary) Resource } return resource } -func GetAMPWorkspace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAMPWorkspace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { workspaceID := fields["id"] client := amp.NewFromConfig(cfg) @@ -62,7 +63,7 @@ func GetAMPWorkspace(ctx context.Context, cfg aws.Config, fields map[string]stri return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Workspaces { if *v.WorkspaceId != workspaceID { continue diff --git a/provider/describer/amplify.go b/provider/describer/amplify.go index bf862ffb..c88a0dad 100755 --- a/provider/describer/amplify.go +++ b/provider/describer/amplify.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/service/amplify/types" @@ -10,10 +11,10 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func AmplifyApp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AmplifyApp(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := amplify.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListApps(ctx, &lify.ListAppsInput{ MaxResults: 100, @@ -43,9 +44,9 @@ func AmplifyApp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func amplifyAppHandle(ctx context.Context, item types.App) Resource { +func amplifyAppHandle(ctx context.Context, item types.App) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *item.Name, ARN: *item.AppArn, @@ -56,7 +57,7 @@ func amplifyAppHandle(ctx context.Context, item types.App) Resource { } return resource } -func GetAmplifyApp(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAmplifyApp(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { appId := fields["appId"] client := amplify.NewFromConfig(cfg) @@ -68,7 +69,7 @@ func GetAmplifyApp(ctx context.Context, cfg aws.Config, fields map[string]string return nil, err } - var values []Resource + var values []models.Resource for _, app := range out.Apps { if *app.AppId != appId { continue diff --git a/provider/describer/apigateway.go b/provider/describer/apigateway.go index cb47caa2..5fb21627 100755 --- a/provider/describer/apigateway.go +++ b/provider/describer/apigateway.go @@ -4,6 +4,7 @@ import ( "context" _ "database/sql/driver" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/apigateway" @@ -13,11 +14,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func ApiGatewayStage(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayStage(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigateway.NewFromConfig(cfg) paginator := apigateway.NewGetRestApisPaginator(client, &apigateway.GetRestApisInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -48,10 +49,10 @@ func ApiGatewayStage(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func apiGatewayStageHandle(ctx context.Context, stageItem types.Stage, id string, name string) Resource { +func apiGatewayStageHandle(ctx context.Context, stageItem types.Stage, id string, name string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":apigateway:" + describeCtx.Region + "::/restapis/" + id + "/stages/" + *stageItem.StageName - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: name, @@ -62,11 +63,11 @@ func apiGatewayStageHandle(ctx context.Context, stageItem types.Stage, id string } return resource } -func GetApiGatewayStage(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayStage(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { restAPIID := fields["respApiId"] stageName := fields["stageName"] client := apigateway.NewFromConfig(cfg) - var values []Resource + var values []models.Resource stage, err := client.GetStage(ctx, &apigateway.GetStageInput{ RestApiId: &restAPIID, @@ -102,7 +103,7 @@ func GetApiGatewayStage(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func ApiGatewayV2Stage(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayV2Stage(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := apigatewayv2.NewFromConfig(cfg) @@ -122,7 +123,7 @@ func ApiGatewayV2Stage(ctx context.Context, cfg aws.Config, stream *StreamSender return nil, err } - var values []Resource + var values []models.Resource for _, api := range apis { var stages []typesv2.Stage err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { @@ -142,7 +143,7 @@ func ApiGatewayV2Stage(ctx context.Context, cfg aws.Config, stream *StreamSender } for _, stage := range stages { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*api.ApiId, *stage.StageName), Name: *api.Name, @@ -166,11 +167,11 @@ func ApiGatewayV2Stage(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func ApiGatewayRestAPI(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayRestAPI(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigateway.NewFromConfig(cfg) paginator := apigateway.NewGetRestApisPaginator(client, &apigateway.GetRestApisInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -195,10 +196,10 @@ func ApiGatewayRestAPI(ctx context.Context, cfg aws.Config, stream *StreamSender } return values, nil } -func apiGatewayRestAPIHandle(ctx context.Context, restItem types.RestApi) Resource { +func apiGatewayRestAPIHandle(ctx context.Context, restItem types.RestApi) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/restapis/%s", describeCtx.Partition, describeCtx.Region, *restItem.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *restItem.Name, @@ -208,7 +209,7 @@ func apiGatewayRestAPIHandle(ctx context.Context, restItem types.RestApi) Resour } return resource } -func GetApiGatewayRestAPI(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayRestAPI(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] client := apigateway.NewFromConfig(cfg) @@ -222,7 +223,7 @@ func GetApiGatewayRestAPI(ctx context.Context, cfg aws.Config, fields map[string return nil, err } - var values []Resource + var values []models.Resource values = append(values, apiGatewayRestAPIHandle(ctx, types.RestApi{ ApiKeySource: out.ApiKeySource, BinaryMediaTypes: out.BinaryMediaTypes, @@ -241,11 +242,11 @@ func GetApiGatewayRestAPI(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func ApiGatewayApiKey(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayApiKey(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigateway.NewFromConfig(cfg) paginator := apigateway.NewGetApiKeysPaginator(client, &apigateway.GetApiKeysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -270,10 +271,10 @@ func ApiGatewayApiKey(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func apiGatewayApiKeyHandle(ctx context.Context, apiKey types.ApiKey) Resource { +func apiGatewayApiKeyHandle(ctx context.Context, apiKey types.ApiKey) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/apikeys/%s", describeCtx.Partition, describeCtx.Region, *apiKey.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *apiKey.Id, ARN: arn, @@ -284,7 +285,7 @@ func apiGatewayApiKeyHandle(ctx context.Context, apiKey types.ApiKey) Resource { } return resource } -func GetApiGatewayApiKey(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayApiKey(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { apiKeyVa := fields["apiKeyVa"] client := apigateway.NewFromConfig(cfg) @@ -298,7 +299,7 @@ func GetApiGatewayApiKey(ctx context.Context, cfg aws.Config, fields map[string] return nil, err } - var values []Resource + var values []models.Resource values = append(values, apiGatewayApiKeyHandle(ctx, types.ApiKey{ StageKeys: out.StageKeys, Name: out.Name, @@ -314,11 +315,11 @@ func GetApiGatewayApiKey(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func ApiGatewayUsagePlan(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayUsagePlan(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigateway.NewFromConfig(cfg) paginator := apigateway.NewGetUsagePlansPaginator(client, &apigateway.GetUsagePlansInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -343,10 +344,10 @@ func ApiGatewayUsagePlan(ctx context.Context, cfg aws.Config, stream *StreamSend } return values, nil } -func apiGatewayUsagePlanHandle(ctx context.Context, usagePlan types.UsagePlan) Resource { +func apiGatewayUsagePlanHandle(ctx context.Context, usagePlan types.UsagePlan) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/usageplans/%s", describeCtx.Partition, describeCtx.Region, *usagePlan.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *usagePlan.Id, ARN: arn, @@ -357,7 +358,7 @@ func apiGatewayUsagePlanHandle(ctx context.Context, usagePlan types.UsagePlan) R } return resource } -func GetApiGatewayUsagePlan(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayUsagePlan(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { usagePlanId := fields["usagePlanId"] client := apigateway.NewFromConfig(cfg) @@ -371,7 +372,7 @@ func GetApiGatewayUsagePlan(ctx context.Context, cfg aws.Config, fields map[stri return nil, err } - var values []Resource + var values []models.Resource values = append(values, apiGatewayUsagePlanHandle(ctx, types.UsagePlan{ Name: out.Name, Tags: out.Tags, @@ -385,11 +386,11 @@ func GetApiGatewayUsagePlan(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func ApiGatewayAuthorizer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayAuthorizer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigateway.NewFromConfig(cfg) paginator := apigateway.NewGetRestApisPaginator(client, &apigateway.GetRestApisInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -422,10 +423,10 @@ func ApiGatewayAuthorizer(ctx context.Context, cfg aws.Config, stream *StreamSen } return values, nil } -func apiGatewayAuthorizerHandle(ctx context.Context, authorizer types.Authorizer, apiId string, apiName string) Resource { +func apiGatewayAuthorizerHandle(ctx context.Context, authorizer types.Authorizer, apiId string, apiName string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/restapis/%s/authorizer/%s", describeCtx.Partition, describeCtx.Region, apiId, *authorizer.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *authorizer.Id, ARN: arn, @@ -437,10 +438,10 @@ func apiGatewayAuthorizerHandle(ctx context.Context, authorizer types.Authorizer } return resource } -func GetApiGatewayAuthorizer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayAuthorizer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { restApiId := fields["restApiId"] authorizerId := fields["authorizerId"] - var values []Resource + var values []models.Resource client := apigateway.NewFromConfig(cfg) out, err := client.GetAuthorizer(ctx, &apigateway.GetAuthorizerInput{ @@ -469,10 +470,10 @@ func GetApiGatewayAuthorizer(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func ApiGatewayV2API(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayV2API(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigatewayv2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource pagesLeft := true params := &apigatewayv2.GetApisInput{} for pagesLeft { @@ -500,10 +501,10 @@ func ApiGatewayV2API(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func apiGatewayV2APIHandle(ctx context.Context, api typesv2.Api) Resource { +func apiGatewayV2APIHandle(ctx context.Context, api typesv2.Api) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/apis/%s", describeCtx.Partition, describeCtx.Region, *api.ApiId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *api.Name, @@ -513,7 +514,7 @@ func apiGatewayV2APIHandle(ctx context.Context, api typesv2.Api) Resource { } return resource } -func GetApiGatewayV2API(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayV2API(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { apiID := fields["id"] client := apigatewayv2.NewFromConfig(cfg) @@ -527,7 +528,7 @@ func GetApiGatewayV2API(ctx context.Context, cfg aws.Config, fields map[string]s return nil, err } - var values []Resource + var values []models.Resource values = append(values, apiGatewayV2APIHandle(ctx, typesv2.Api{ Name: out.Name, ProtocolType: out.ProtocolType, @@ -549,9 +550,9 @@ func GetApiGatewayV2API(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func ApiGatewayV2DomainName(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayV2DomainName(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigatewayv2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.GetDomainNames(ctx, &apigatewayv2.GetDomainNamesInput{ NextToken: prevToken, @@ -584,10 +585,10 @@ func ApiGatewayV2DomainName(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func apiGatewayV2DomainNameHandle(ctx context.Context, domainName typesv2.DomainName) Resource { +func apiGatewayV2DomainNameHandle(ctx context.Context, domainName typesv2.DomainName) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/domainnames/%s", describeCtx.Partition, describeCtx.Region, *domainName.DomainName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *domainName.DomainName, @@ -597,7 +598,7 @@ func apiGatewayV2DomainNameHandle(ctx context.Context, domainName typesv2.Domain } return resource } -func GetApiGatewayV2DomainName(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayV2DomainName(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { domainName := fields["domain_name"] client := apigatewayv2.NewFromConfig(cfg) @@ -611,7 +612,7 @@ func GetApiGatewayV2DomainName(ctx context.Context, cfg aws.Config, fields map[s return nil, err } - var values []Resource + var values []models.Resource values = append(values, apiGatewayV2DomainNameHandle(ctx, typesv2.DomainName{ DomainName: out.DomainName, ApiMappingSelectionExpression: out.ApiMappingSelectionExpression, @@ -622,10 +623,10 @@ func GetApiGatewayV2DomainName(ctx context.Context, cfg aws.Config, fields map[s return values, nil } -func ApiGatewayV2Integration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayV2Integration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigatewayv2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (*string, error) { output, err := client.GetApis(ctx, &apigatewayv2.GetApisInput{ NextToken: prevToken, @@ -683,10 +684,10 @@ func ApiGatewayV2Integration(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func apiGatewayV2IntegrationHandle(ctx context.Context, integration typesv2.Integration, apiId string) Resource { +func apiGatewayV2IntegrationHandle(ctx context.Context, integration typesv2.Integration, apiId string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/apis/%s/integrations/%s", describeCtx.Partition, describeCtx.Region, apiId, *integration.IntegrationId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *integration.IntegrationId, @@ -697,7 +698,7 @@ func apiGatewayV2IntegrationHandle(ctx context.Context, integration typesv2.Inte } return resource } -func GetApiGatewayV2Integration(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayV2Integration(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { apiId := fields["api_id"] integrationID := fields["id"] @@ -721,7 +722,7 @@ func GetApiGatewayV2Integration(ctx context.Context, cfg aws.Config, fields map[ return nil, err } - var values []Resource + var values []models.Resource integration := typesv2.Integration{ ApiGatewayManaged: out.ApiGatewayManaged, ConnectionId: out.ConnectionId, @@ -748,9 +749,9 @@ func GetApiGatewayV2Integration(ctx context.Context, cfg aws.Config, fields map[ return values, nil } -func ApiGatewayDomainName(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayDomainName(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigateway.NewFromConfig(cfg) - var values []Resource + var values []models.Resource pager := apigateway.NewGetDomainNamesPaginator(client, &apigateway.GetDomainNamesInput{}) for pager.HasMorePages() { output, err := pager.NextPage(ctx) @@ -774,10 +775,10 @@ func ApiGatewayDomainName(ctx context.Context, cfg aws.Config, stream *StreamSen } return values, nil } -func apiGatewayDomainNameHandle(ctx context.Context, domainName types.DomainName) Resource { +func apiGatewayDomainNameHandle(ctx context.Context, domainName types.DomainName) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/domainname/%s", describeCtx.Partition, describeCtx.Region, *domainName.DomainName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *domainName.DomainName, @@ -787,7 +788,7 @@ func apiGatewayDomainNameHandle(ctx context.Context, domainName types.DomainName } return resource } -func GetApiGatewayDomainName(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApiGatewayDomainName(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { domainName := fields["domain_name"] client := apigateway.NewFromConfig(cfg) @@ -801,7 +802,7 @@ func GetApiGatewayDomainName(ctx context.Context, cfg aws.Config, fields map[str return nil, err } - var values []Resource + var values []models.Resource values = append(values, apiGatewayDomainNameHandle(ctx, types.DomainName{ DomainName: out.DomainName, CertificateName: out.CertificateName, @@ -824,14 +825,14 @@ func GetApiGatewayDomainName(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func ApiGatewayV2Route(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApiGatewayV2Route(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := apigatewayv2.NewFromConfig(cfg) apis, err := ApiGatewayV2API(ctx, cfg, nil) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, a := range apis { api := a.Description.(model.ApiGatewayV2APIDescription).API output, err := client.GetRoutes(ctx, &apigatewayv2.GetRoutesInput{ @@ -857,10 +858,10 @@ func ApiGatewayV2Route(ctx context.Context, cfg aws.Config, stream *StreamSender } return values, nil } -func apiGatewayV2Route(ctx context.Context, route typesv2.Route) Resource { +func apiGatewayV2Route(ctx context.Context, route typesv2.Route) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:apigateway:%s::/apis/%s/routes/%s", describeCtx.Partition, describeCtx.Region, *route.RouteId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *route.RouteId, diff --git a/provider/describer/appautoscaling.go b/provider/describer/appautoscaling.go index 54a3a807..8f063f1f 100755 --- a/provider/describer/appautoscaling.go +++ b/provider/describer/appautoscaling.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" _ "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -11,10 +12,10 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func ApplicationAutoScalingTarget(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApplicationAutoScalingTarget(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := applicationautoscaling.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, serviceNameSpace := range types.ServiceNamespaceEcs.Values() { paginator := applicationautoscaling.NewDescribeScalableTargetsPaginator(client, &applicationautoscaling.DescribeScalableTargetsInput{ ServiceNamespace: serviceNameSpace, @@ -41,11 +42,11 @@ func ApplicationAutoScalingTarget(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func applicationAutoScalingTargetHandle(ctx context.Context, item types.ScalableTarget) Resource { +func applicationAutoScalingTargetHandle(ctx context.Context, item types.ScalableTarget) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":application-autoscaling:" + describeCtx.Region + ":" + describeCtx.AccountID + ":service-namespace:" + string(item.ServiceNamespace) + "/target/" + *item.ResourceId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *item.ResourceId, @@ -56,10 +57,10 @@ func applicationAutoScalingTargetHandle(ctx context.Context, item types.Scalable return resource } -func GetApplicationAutoScalingTarget(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApplicationAutoScalingTarget(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { resourceId := fields["resourceId"] client := applicationautoscaling.NewFromConfig(cfg) - var values []Resource + var values []models.Resource describers, err := client.DescribeScalableTargets(ctx, &applicationautoscaling.DescribeScalableTargetsInput{ ResourceIds: []string{resourceId}, @@ -75,10 +76,10 @@ func GetApplicationAutoScalingTarget(ctx context.Context, cfg aws.Config, fields return values, nil } -func ApplicationAutoScalingPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApplicationAutoScalingPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := applicationautoscaling.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, serviceNameSpace := range types.ServiceNamespaceEcs.Values() { paginator := applicationautoscaling.NewDescribeScalingPoliciesPaginator(client, &applicationautoscaling.DescribeScalingPoliciesInput{ ServiceNamespace: serviceNameSpace, @@ -105,11 +106,11 @@ func ApplicationAutoScalingPolicy(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func applicationAutoScalingPolicyHandle(ctx context.Context, item types.ScalingPolicy) Resource { +func applicationAutoScalingPolicyHandle(ctx context.Context, item types.ScalingPolicy) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":application-autoscaling:" + describeCtx.Region + ":" + describeCtx.AccountID + ":service-namespace:" + string(item.ServiceNamespace) + "/target/" + *item.ResourceId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *item.ResourceId, @@ -120,10 +121,10 @@ func applicationAutoScalingPolicyHandle(ctx context.Context, item types.ScalingP return resource } -func GetApplicationAutoScalingPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApplicationAutoScalingPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { resourceId := fields["resourceId"] client := applicationautoscaling.NewFromConfig(cfg) - var values []Resource + var values []models.Resource describers, err := client.DescribeScalingPolicies(ctx, &applicationautoscaling.DescribeScalingPoliciesInput{ ResourceId: &resourceId, diff --git a/provider/describer/appconfig.go b/provider/describer/appconfig.go index c7ccd195..cb673691 100755 --- a/provider/describer/appconfig.go +++ b/provider/describer/appconfig.go @@ -10,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func AppConfigApplication(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AppConfigApplication(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := appconfig.NewFromConfig(cfg) paginator := appconfig.NewListApplicationsPaginator(client, &appconfig.ListApplicationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -38,7 +38,7 @@ func AppConfigApplication(ctx context.Context, cfg aws.Config, stream *StreamSen } return values, nil } -func appConfigApplicationHandle(ctx context.Context, cfg aws.Config, application types.Application) (Resource, error) { +func appConfigApplicationHandle(ctx context.Context, cfg aws.Config, application types.Application) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := appconfig.NewFromConfig(cfg) arn := fmt.Sprintf("arn:%s:appconfig:%s:%s:application/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *application.Id) @@ -47,10 +47,10 @@ func appConfigApplicationHandle(ctx context.Context, cfg aws.Config, application ResourceArn: aws.String(arn), }) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *application.Id, Name: *application.Name, @@ -62,8 +62,8 @@ func appConfigApplicationHandle(ctx context.Context, cfg aws.Config, application } return resource, nil } -func GetAppConfigApplication(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetAppConfigApplication(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource applicationId := fields["id"] client := appconfig.NewFromConfig(cfg) applications, err := client.ListApplications(ctx, &appconfig.ListApplicationsInput{}) diff --git a/provider/describer/applicationinsight.go b/provider/describer/applicationinsight.go index e78bb42c..9252cf03 100755 --- a/provider/describer/applicationinsight.go +++ b/provider/describer/applicationinsight.go @@ -2,17 +2,18 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/applicationinsights" ) -func ApplicationInsightsApplication(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApplicationInsightsApplication(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := applicationinsights.NewFromConfig(cfg) paginator := applicationinsights.NewListApplicationsPaginator(client, &applicationinsights.ListApplicationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -20,7 +21,7 @@ func ApplicationInsightsApplication(ctx context.Context, cfg aws.Config, stream } for _, v := range page.ApplicationInfoList { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ResourceGroupName, Name: *v.ResourceGroupName, diff --git a/provider/describer/appstream.go b/provider/describer/appstream.go index a629bae1..74d4be26 100755 --- a/provider/describer/appstream.go +++ b/provider/describer/appstream.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/appstream" @@ -9,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func AppStreamApplication(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AppStreamApplication(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := appstream.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeApplications(ctx, &appstream.DescribeApplicationsInput{ NextToken: prevToken, @@ -29,7 +30,7 @@ func AppStreamApplication(ctx context.Context, cfg aws.Config, stream *StreamSen if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.Arn, Name: *item.Name, @@ -56,10 +57,10 @@ func AppStreamApplication(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func AppStreamStack(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AppStreamStack(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := appstream.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeStacks(ctx, &appstream.DescribeStacksInput{ NextToken: prevToken, @@ -71,7 +72,7 @@ func AppStreamStack(ctx context.Context, cfg aws.Config, stream *StreamSender) ( for _, item := range output.Stacks { resource, err := appStreamStackHandle(ctx, cfg, item) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -96,7 +97,7 @@ func AppStreamStack(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func appStreamStackHandle(ctx context.Context, cfg aws.Config, item types.Stack) (Resource, error) { +func appStreamStackHandle(ctx context.Context, cfg aws.Config, item types.Stack) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := appstream.NewFromConfig(cfg) @@ -105,12 +106,12 @@ func appStreamStackHandle(ctx context.Context, cfg aws.Config, item types.Stack) }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.Arn, Name: *item.Name, @@ -121,7 +122,7 @@ func appStreamStackHandle(ctx context.Context, cfg aws.Config, item types.Stack) } return resource, nil } -func GetAppStreamStack(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAppStreamStack(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := appstream.NewFromConfig(cfg) out, err := client.DescribeStacks(ctx, &appstream.DescribeStacksInput{ @@ -134,11 +135,11 @@ func GetAppStreamStack(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Stacks { resource, err := appStreamStackHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -151,10 +152,10 @@ func GetAppStreamStack(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func AppStreamFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AppStreamFleet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := appstream.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeFleets(ctx, &appstream.DescribeFleetsInput{ NextToken: prevToken, @@ -165,7 +166,7 @@ func AppStreamFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ( for _, item := range output.Fleets { resource, err := appStreamFleetHandle(ctx, cfg, item) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -189,7 +190,7 @@ func AppStreamFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func appStreamFleetHandle(ctx context.Context, cfg aws.Config, item types.Fleet) (Resource, error) { +func appStreamFleetHandle(ctx context.Context, cfg aws.Config, item types.Fleet) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := appstream.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &appstream.ListTagsForResourceInput{ @@ -197,12 +198,12 @@ func appStreamFleetHandle(ctx context.Context, cfg aws.Config, item types.Fleet) }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.Arn, Name: *item.Name, @@ -214,7 +215,7 @@ func appStreamFleetHandle(ctx context.Context, cfg aws.Config, item types.Fleet) return resource, nil } -func GetAppStreamFleet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAppStreamFleet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := appstream.NewFromConfig(cfg) @@ -228,11 +229,11 @@ func GetAppStreamFleet(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Fleets { resource, err := appStreamFleetHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -245,10 +246,10 @@ func GetAppStreamFleet(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func AppStreamImage(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AppStreamImage(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := appstream.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeImages(ctx, &appstream.DescribeImagesInput{ NextToken: prevToken, @@ -263,7 +264,7 @@ func AppStreamImage(ctx context.Context, cfg aws.Config, stream *StreamSender) ( for _, item := range output.Images { resource, err := appStreamImageHandle(ctx, cfg, item) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -291,7 +292,7 @@ func AppStreamImage(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func appStreamImageHandle(ctx context.Context, cfg aws.Config, item types.Image) (Resource, error) { +func appStreamImageHandle(ctx context.Context, cfg aws.Config, item types.Image) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := appstream.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &appstream.ListTagsForResourceInput{ @@ -299,12 +300,12 @@ func appStreamImageHandle(ctx context.Context, cfg aws.Config, item types.Image) }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") || isErr(err, "AccessDeniedException") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.Arn, Name: *item.Name, @@ -316,7 +317,7 @@ func appStreamImageHandle(ctx context.Context, cfg aws.Config, item types.Image) return resource, nil } -func GetAppStreamImage(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAppStreamImage(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := appstream.NewFromConfig(cfg) @@ -330,11 +331,11 @@ func GetAppStreamImage(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Images { resource, err := appStreamImageHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/athenaquery.go b/provider/describer/athenaquery.go index 898ac819..73647783 100644 --- a/provider/describer/athenaquery.go +++ b/provider/describer/athenaquery.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/athena" @@ -9,10 +10,10 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func AthenaWrokgroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AthenaWrokgroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := athena.NewFromConfig(cfg) pager := athena.NewListWorkGroupsPaginator(client, &athena.ListWorkGroupsInput{}) - var values []Resource + var values []models.Resource for pager.HasMorePages() { page, err := pager.NextPage(ctx) if err != nil { @@ -20,7 +21,7 @@ func AthenaWrokgroup(ctx context.Context, cfg aws.Config, stream *StreamSender) } for _, item := range page.WorkGroups { resource, err := authenaWorkgroupHandle(ctx, cfg, item) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -40,7 +41,7 @@ func AthenaWrokgroup(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func authenaWorkgroupHandle(ctx context.Context, cfg aws.Config, item types.WorkGroupSummary) (Resource, error) { +func authenaWorkgroupHandle(ctx context.Context, cfg aws.Config, item types.WorkGroupSummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := athena.NewFromConfig(cfg) output, err := client.GetWorkGroup(ctx, &athena.GetWorkGroupInput{ @@ -48,11 +49,11 @@ func authenaWorkgroupHandle(ctx context.Context, cfg aws.Config, item types.Work }) if err != nil { if isErr(err, "GetWorkGroupNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *output.WorkGroup.Name, Description: model.AthenaWorkGroupDescription{ @@ -63,10 +64,10 @@ func authenaWorkgroupHandle(ctx context.Context, cfg aws.Config, item types.Work return resource, nil } -func AthenaQueryExecution(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AthenaQueryExecution(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := athena.NewFromConfig(cfg) pager := athena.NewListQueryExecutionsPaginator(client, &athena.ListQueryExecutionsInput{}) - var values []Resource + var values []models.Resource for pager.HasMorePages() { page, err := pager.NextPage(ctx) if err != nil { @@ -74,7 +75,7 @@ func AthenaQueryExecution(ctx context.Context, cfg aws.Config, stream *StreamSen } for _, item := range page.QueryExecutionIds { resource, err := authenaQueryExecutionHandle(ctx, cfg, item) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -94,7 +95,7 @@ func AthenaQueryExecution(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func authenaQueryExecutionHandle(ctx context.Context, cfg aws.Config, id string) (Resource, error) { +func authenaQueryExecutionHandle(ctx context.Context, cfg aws.Config, id string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := athena.NewFromConfig(cfg) output, err := client.GetQueryExecution(ctx, &athena.GetQueryExecutionInput{ @@ -102,11 +103,11 @@ func authenaQueryExecutionHandle(ctx context.Context, cfg aws.Config, id string) }) if err != nil { if isErr(err, "GetQueryExecutionNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *output.QueryExecution.QueryExecutionId, Name: *output.QueryExecution.Query, diff --git a/provider/describer/auditmanager.go b/provider/describer/auditmanager.go index 340171a7..7cae0252 100755 --- a/provider/describer/auditmanager.go +++ b/provider/describer/auditmanager.go @@ -5,20 +5,21 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/auditmanager" "github.com/opengovern/og-describer-aws/provider/model" ) -func AuditManagerAssessment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AuditManagerAssessment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := auditmanager.NewFromConfig(cfg) paginator := auditmanager.NewListAssessmentsPaginator(client, &auditmanager.ListAssessmentsInput{}) // - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -34,7 +35,7 @@ func AuditManagerAssessment(ctx context.Context, cfg aws.Config, stream *StreamS return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *assessment.Assessment.Arn, Name: *assessment.Assessment.Metadata.Name, @@ -56,11 +57,11 @@ func AuditManagerAssessment(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func AuditManagerControl(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AuditManagerControl(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := auditmanager.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, ctype := range []types.ControlType{types.ControlTypeStandard, types.ControlTypeCustom} { paginator := auditmanager.NewListControlsPaginator(client, &auditmanager.ListControlsInput{ ControlType: ctype, @@ -80,7 +81,7 @@ func AuditManagerControl(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *control.Control.Arn, Name: *control.Control.Name, @@ -103,7 +104,7 @@ func AuditManagerControl(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func GetAuditManagerControl(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAuditManagerControl(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) controlID := fields["id"] client := auditmanager.NewFromConfig(cfg) @@ -114,8 +115,8 @@ func GetAuditManagerControl(ctx context.Context, cfg aws.Config, fields map[stri return nil, err } - var values []Resource - values = append(values, Resource{ + var values []models.Resource + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *control.Control.Arn, Name: *control.Control.Name, @@ -128,12 +129,12 @@ func GetAuditManagerControl(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func AuditManagerEvidence(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AuditManagerEvidence(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := auditmanager.NewFromConfig(cfg) paginator := auditmanager.NewListAssessmentsPaginator(client, &auditmanager.ListAssessmentsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -164,7 +165,7 @@ func AuditManagerEvidence(ctx context.Context, cfg aws.Config, stream *StreamSen for _, evidence := range evidencePage.Evidence { arn := fmt.Sprintf("arn:%s:auditmanager:%s:%s:evidence/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *evidence.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *evidence.Id, @@ -191,12 +192,12 @@ func AuditManagerEvidence(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func AuditManagerEvidenceFolder(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AuditManagerEvidenceFolder(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := auditmanager.NewFromConfig(cfg) paginator := auditmanager.NewListAssessmentsPaginator(client, &auditmanager.ListAssessmentsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -216,7 +217,7 @@ func AuditManagerEvidenceFolder(ctx context.Context, cfg aws.Config, stream *Str for _, evidenceFolder := range evidenceFolderPage.EvidenceFolders { arn := fmt.Sprintf("arn:%s:auditmanager:%s:%s:evidence-folder/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *evidenceFolder.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *evidenceFolder.Name, @@ -241,11 +242,11 @@ func AuditManagerEvidenceFolder(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func AuditManagerFramework(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AuditManagerFramework(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := auditmanager.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, ftype := range []types.FrameworkType{types.FrameworkTypeStandard, types.FrameworkTypeCustom} { paginator := auditmanager.NewListAssessmentFrameworksPaginator(client, &auditmanager.ListAssessmentFrameworksInput{ FrameworkType: ftype, @@ -264,7 +265,7 @@ func AuditManagerFramework(ctx context.Context, cfg aws.Config, stream *StreamSe return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *framework.Framework.Arn, Name: *framework.Framework.Name, diff --git a/provider/describer/autoscaling.go b/provider/describer/autoscaling.go index bf6025c4..1392eca4 100755 --- a/provider/describer/autoscaling.go +++ b/provider/describer/autoscaling.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/autoscaling" @@ -9,12 +10,12 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func AutoScalingAutoScalingGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AutoScalingAutoScalingGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := autoscaling.NewFromConfig(cfg) paginator := autoscaling.NewDescribeAutoScalingGroupsPaginator(client, &autoscaling.DescribeAutoScalingGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -32,7 +33,7 @@ func AutoScalingAutoScalingGroup(ctx context.Context, cfg aws.Config, stream *St return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AutoScalingGroupARN, Name: *v.AutoScalingGroupName, @@ -51,7 +52,7 @@ func AutoScalingAutoScalingGroup(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func GetAutoScalingAutoScalingGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAutoScalingAutoScalingGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) autoScalingGroupName := fields["name"] client := autoscaling.NewFromConfig(cfg) @@ -63,7 +64,7 @@ func GetAutoScalingAutoScalingGroup(ctx context.Context, cfg aws.Config, fields return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.AutoScalingGroups { var desc model.AutoScalingGroupDescription @@ -76,7 +77,7 @@ func GetAutoScalingAutoScalingGroup(ctx context.Context, cfg aws.Config, fields return nil, err } - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AutoScalingGroupARN, Name: *v.AutoScalingGroupName, @@ -106,12 +107,12 @@ func getAutoScalingPolicies(ctx context.Context, cfg aws.Config, asgName *string return values, nil } -func AutoScalingLaunchConfiguration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AutoScalingLaunchConfiguration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := autoscaling.NewFromConfig(cfg) paginator := autoscaling.NewDescribeLaunchConfigurationsPaginator(client, &autoscaling.DescribeLaunchConfigurationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -119,7 +120,7 @@ func AutoScalingLaunchConfiguration(ctx context.Context, cfg aws.Config, stream } for _, v := range page.LaunchConfigurations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.LaunchConfigurationARN, Name: *v.LaunchConfigurationName, @@ -140,7 +141,7 @@ func AutoScalingLaunchConfiguration(ctx context.Context, cfg aws.Config, stream return values, nil } -func GetAutoScalingLaunchConfiguration(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetAutoScalingLaunchConfiguration(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) launchConfigurationName := fields["name"] client := autoscaling.NewFromConfig(cfg) @@ -151,9 +152,9 @@ func GetAutoScalingLaunchConfiguration(ctx context.Context, cfg aws.Config, fiel return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.LaunchConfigurations { - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *v.LaunchConfigurationARN, Name: *v.LaunchConfigurationName, @@ -166,7 +167,7 @@ func GetAutoScalingLaunchConfiguration(ctx context.Context, cfg aws.Config, fiel return values, nil } -func AutoScalingLifecycleHook(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AutoScalingLifecycleHook(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) groups, err := AutoScalingAutoScalingGroup(ctx, cfg, nil) if groups != nil { @@ -175,7 +176,7 @@ func AutoScalingLifecycleHook(ctx context.Context, cfg aws.Config, stream *Strea client := autoscaling.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, g := range groups { group := g.Description.(types.AutoScalingGroup) output, err := client.DescribeLifecycleHooks(ctx, &autoscaling.DescribeLifecycleHooksInput{ @@ -186,7 +187,7 @@ func AutoScalingLifecycleHook(ctx context.Context, cfg aws.Config, stream *Strea } for _, v := range output.LifecycleHooks { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*v.AutoScalingGroupName, *v.LifecycleHookName), Name: *v.AutoScalingGroupName, @@ -205,12 +206,12 @@ func AutoScalingLifecycleHook(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func AutoScalingScalingPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AutoScalingScalingPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := autoscaling.NewFromConfig(cfg) paginator := autoscaling.NewDescribePoliciesPaginator(client, &autoscaling.DescribePoliciesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -218,7 +219,7 @@ func AutoScalingScalingPolicy(ctx context.Context, cfg aws.Config, stream *Strea } for _, v := range page.ScalingPolicies { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.PolicyARN, Name: *v.PolicyName, @@ -237,12 +238,12 @@ func AutoScalingScalingPolicy(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func AutoScalingScheduledAction(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AutoScalingScheduledAction(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := autoscaling.NewFromConfig(cfg) paginator := autoscaling.NewDescribeScheduledActionsPaginator(client, &autoscaling.DescribeScheduledActionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -250,7 +251,7 @@ func AutoScalingScheduledAction(ctx context.Context, cfg aws.Config, stream *Str } for _, v := range page.ScheduledUpdateGroupActions { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ScheduledActionARN, Name: *v.ScheduledActionName, @@ -269,7 +270,7 @@ func AutoScalingScheduledAction(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func AutoScalingWarmPool(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func AutoScalingWarmPool(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) groups, err := AutoScalingAutoScalingGroup(ctx, cfg, nil) if groups != nil { @@ -278,7 +279,7 @@ func AutoScalingWarmPool(ctx context.Context, cfg aws.Config, stream *StreamSend client := autoscaling.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, g := range groups { group := g.Description.(types.AutoScalingGroup) @@ -292,7 +293,7 @@ func AutoScalingWarmPool(ctx context.Context, cfg aws.Config, stream *StreamSend } for _, v := range output.Instances { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*group.AutoScalingGroupName, *v.InstanceId), // TODO Name: *v.LaunchConfigurationName, diff --git a/provider/describer/backup.go b/provider/describer/backup.go index 525b8468..fcb418f8 100755 --- a/provider/describer/backup.go +++ b/provider/describer/backup.go @@ -5,18 +5,19 @@ import ( "regexp" "github.com/aws/aws-sdk-go-v2/service/backup/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/backup" "github.com/opengovern/og-describer-aws/provider/model" ) -func BackupPlan(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupPlan(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := backup.NewFromConfig(cfg) paginator := backup.NewListBackupPlansPaginator(client, &backup.ListBackupPlansInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -29,7 +30,7 @@ func BackupPlan(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.BackupPlanArn, Name: *v.BackupPlanName, @@ -51,12 +52,12 @@ func BackupPlan(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func BackupRecoveryPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupRecoveryPoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := backup.NewFromConfig(cfg) paginator := backup.NewListBackupVaultsPaginator(client, &backup.ListBackupVaultsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -110,7 +111,7 @@ func BackupRecoveryPoint(ctx context.Context, cfg aws.Config, stream *StreamSend } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *recoveryPoint.RecoveryPointArn, Name: nameFromArn(*out.RecoveryPointArn), @@ -134,12 +135,12 @@ func BackupRecoveryPoint(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func BackupProtectedResource(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupProtectedResource(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := backup.NewFromConfig(cfg) paginator := backup.NewListProtectedResourcesPaginator(client, &backup.ListProtectedResourcesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -147,7 +148,7 @@ func BackupProtectedResource(ctx context.Context, cfg aws.Config, stream *Stream } for _, resource := range page.Results { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *resource.ResourceArn, Name: nameFromArn(*resource.ResourceArn), @@ -168,7 +169,7 @@ func BackupProtectedResource(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func BackupSelection(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupSelection(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) plans, err := BackupPlan(ctx, cfg, nil) @@ -178,7 +179,7 @@ func BackupSelection(ctx context.Context, cfg aws.Config, stream *StreamSender) client := backup.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, plan := range plans { paginator := backup.NewListBackupSelectionsPaginator(client, &backup.ListBackupSelectionsInput{ BackupPlanId: plan.Description.(model.BackupPlanDescription).BackupPlan.BackupPlanId, @@ -200,7 +201,7 @@ func BackupSelection(ctx context.Context, cfg aws.Config, stream *StreamSender) } name := "arn:" + describeCtx.Partition + ":backup:" + describeCtx.Region + ":" + describeCtx.AccountID + ":backup-plan:" + *v.BackupPlanId + "/selection/" + *v.SelectionId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: name, Name: *v.SelectionName, @@ -224,11 +225,11 @@ func BackupSelection(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func BackupVault(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupVault(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := backup.NewFromConfig(cfg) paginator := backup.NewListBackupVaultsPaginator(client, &backup.ListBackupVaultsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -260,7 +261,7 @@ func BackupVault(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func backupVaultHandle(ctx context.Context, cfg aws.Config, v types.BackupVaultListMember, notification *backup.GetBackupVaultNotificationsOutput) (Resource, error) { +func backupVaultHandle(ctx context.Context, cfg aws.Config, v types.BackupVaultListMember, notification *backup.GetBackupVaultNotificationsOutput) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := backup.NewFromConfig(cfg) accessPolicy, err := client.GetBackupVaultAccessPolicy(ctx, &backup.GetBackupVaultAccessPolicyInput{ @@ -270,7 +271,7 @@ func backupVaultHandle(ctx context.Context, cfg aws.Config, v types.BackupVaultL if isErr(err, "ResourceNotFoundException") || isErr(err, "InvalidParameter") { accessPolicy = &backup.GetBackupVaultAccessPolicyOutput{} } else { - return Resource{}, err + return models.Resource{}, err } } tags := make(map[string]string) @@ -287,7 +288,7 @@ func backupVaultHandle(ctx context.Context, cfg aws.Config, v types.BackupVaultL tags = op.Tags } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.BackupVaultArn, Name: *v.BackupVaultName, @@ -301,7 +302,7 @@ func backupVaultHandle(ctx context.Context, cfg aws.Config, v types.BackupVaultL } return resource, nil } -func GetBackupVault(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetBackupVault(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { backupVaultName := fields["name"] client := backup.NewFromConfig(cfg) @@ -313,7 +314,7 @@ func GetBackupVault(ctx context.Context, cfg aws.Config, fields map[string]strin return nil, err } - var values []Resource + var values []models.Resource for _, v := range listBackup.BackupVaultList { if *v.BackupVaultName != backupVaultName { @@ -331,11 +332,11 @@ func GetBackupVault(ctx context.Context, cfg aws.Config, fields map[string]strin return values, nil } -func BackupFramework(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupFramework(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := backup.NewFromConfig(cfg) paginator := backup.NewListFrameworksPaginator(client, &backup.ListFrameworksInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -368,7 +369,7 @@ func BackupFramework(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func backupFrameworkHandle(ctx context.Context, cfg aws.Config, v types.Framework) (Resource, error) { +func backupFrameworkHandle(ctx context.Context, cfg aws.Config, v types.Framework) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := backup.NewFromConfig(cfg) @@ -376,14 +377,14 @@ func backupFrameworkHandle(ctx context.Context, cfg aws.Config, v types.Framewor FrameworkName: v.FrameworkName, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } tags, err := client.ListTags(ctx, &backup.ListTagsInput{ ResourceArn: v.FrameworkArn, }) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.FrameworkArn, Name: *v.FrameworkName, @@ -394,8 +395,8 @@ func backupFrameworkHandle(ctx context.Context, cfg aws.Config, v types.Framewor } return resource, nil } -func GetBackupFramework(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetBackupFramework(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource frameworkName := fields["name"] client := backup.NewFromConfig(cfg) @@ -424,12 +425,12 @@ func GetBackupFramework(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func BackupLegalHold(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupLegalHold(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := backup.NewFromConfig(cfg) paginator := backup.NewListLegalHoldsPaginator(client, &backup.ListLegalHoldsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -444,7 +445,7 @@ func BackupLegalHold(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *v.Title, ARN: *v.LegalHoldArn, @@ -466,11 +467,11 @@ func BackupLegalHold(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func BackupReportPlan(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupReportPlan(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := backup.NewFromConfig(cfg) paginator := backup.NewListReportPlansPaginator(client, &backup.ListReportPlansInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -495,7 +496,7 @@ func BackupReportPlan(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func backupReportPlanHandle(ctx context.Context, cfg aws.Config, v types.ReportPlan) (Resource, error) { +func backupReportPlanHandle(ctx context.Context, cfg aws.Config, v types.ReportPlan) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := backup.NewFromConfig(cfg) @@ -503,14 +504,14 @@ func backupReportPlanHandle(ctx context.Context, cfg aws.Config, v types.ReportP ReportPlanName: v.ReportPlanName, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } tags, err := client.ListTags(ctx, &backup.ListTagsInput{ ResourceArn: v.ReportPlanArn, }) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ReportPlanArn, Name: *v.ReportPlanName, @@ -521,8 +522,8 @@ func backupReportPlanHandle(ctx context.Context, cfg aws.Config, v types.ReportP } return resource, nil } -func GetBackupReportPlan(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetBackupReportPlan(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource name := fields["name"] client := backup.NewFromConfig(cfg) @@ -551,7 +552,7 @@ func GetBackupReportPlan(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func BackupRegionSetting(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BackupRegionSetting(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := backup.NewFromConfig(cfg) regionSetting, err := client.DescribeRegionSettings(ctx, &backup.DescribeRegionSettingsInput{}) @@ -559,9 +560,9 @@ func BackupRegionSetting(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - var values []Resource + var values []models.Resource - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.BackupRegionSettingDescription{ Region: describeCtx.OGRegion, diff --git a/provider/describer/batch.go b/provider/describer/batch.go index 30fbd002..90abb203 100755 --- a/provider/describer/batch.go +++ b/provider/describer/batch.go @@ -4,6 +4,7 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/batch/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" _ "golang.org/x/tools/go/analysis/passes/ctrlflow" "github.com/aws/aws-sdk-go-v2/aws" @@ -11,11 +12,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func BatchComputeEnvironment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BatchComputeEnvironment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := batch.NewFromConfig(cfg) paginator := batch.NewDescribeComputeEnvironmentsPaginator(client, &batch.DescribeComputeEnvironmentsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -36,9 +37,9 @@ func BatchComputeEnvironment(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func batchComputeEnvironmentHandle(ctx context.Context, v types.ComputeEnvironmentDetail) Resource { +func batchComputeEnvironmentHandle(ctx context.Context, v types.ComputeEnvironmentDetail) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ComputeEnvironmentArn, Name: *v.ComputeEnvironmentName, @@ -48,8 +49,8 @@ func batchComputeEnvironmentHandle(ctx context.Context, v types.ComputeEnvironme } return resource } -func GetBatchComputeEnvironment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetBatchComputeEnvironment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource ComputeEnvironments := fields["computeEnvironment"] client := batch.NewFromConfig(cfg) deComputeEnv, err := client.DescribeComputeEnvironments(ctx, &batch.DescribeComputeEnvironmentsInput{ @@ -69,11 +70,11 @@ func GetBatchComputeEnvironment(ctx context.Context, cfg aws.Config, fields map[ return values, nil } -func BatchJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BatchJob(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := batch.NewFromConfig(cfg) paginator := batch.NewDescribeJobQueuesPaginator(client, &batch.DescribeJobQueuesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -105,9 +106,9 @@ func BatchJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func batchJobHandle(ctx context.Context, v types.JobSummary) Resource { +func batchJobHandle(ctx context.Context, v types.JobSummary) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.JobArn, Name: *v.JobName, @@ -117,9 +118,9 @@ func batchJobHandle(ctx context.Context, v types.JobSummary) Resource { } return resource } -func GetBatchJob(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetBatchJob(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { jobQueues := fields["jobQueues"] - var values []Resource + var values []models.Resource client := batch.NewFromConfig(cfg) jobqs, err := client.DescribeJobQueues(ctx, &batch.DescribeJobQueuesInput{ @@ -153,19 +154,19 @@ func GetBatchJob(ctx context.Context, cfg aws.Config, fields map[string]string) return values, nil } -func BatchJobQueue(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func BatchJobQueue(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := batch.NewFromConfig(cfg) paginator := batch.NewDescribeJobQueuesPaginator(client, &batch.DescribeJobQueuesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } for _, jq := range page.JobQueues { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *jq.JobQueueArn, Name: *jq.JobQueueName, diff --git a/provider/describer/cloudcontrol.go b/provider/describer/cloudcontrol.go index 8a6d3b85..a032c645 100755 --- a/provider/describer/cloudcontrol.go +++ b/provider/describer/cloudcontrol.go @@ -2,19 +2,20 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/opengovern/og-describer-aws/provider/model" ) -func CloudControlResource(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudControlResource(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudcontrol.NewFromConfig(cfg) paginator := cloudcontrol.NewListResourcesPaginator(client, &cloudcontrol.ListResourcesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -22,7 +23,7 @@ func CloudControlResource(ctx context.Context, cfg aws.Config, stream *StreamSen } for _, v := range page.ResourceDescriptions { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Identifier, Description: model.CloudControlResourceDescription{ diff --git a/provider/describer/cloudformation.go b/provider/describer/cloudformation.go index 12c1d493..d3d31387 100755 --- a/provider/describer/cloudformation.go +++ b/provider/describer/cloudformation.go @@ -4,17 +4,18 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/opengovern/og-describer-aws/provider/model" ) -func CloudFormationStack(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFormationStack(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudformation.NewFromConfig(cfg) paginator := cloudformation.NewDescribeStacksPaginator(client, &cloudformation.DescribeStacksInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -42,7 +43,7 @@ func CloudFormationStack(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func cloudFormationStackHandle(ctx context.Context, cfg aws.Config, v types.Stack) (Resource, error) { +func cloudFormationStackHandle(ctx context.Context, cfg aws.Config, v types.Stack) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudformation.NewFromConfig(cfg) @@ -51,7 +52,7 @@ func cloudFormationStackHandle(ctx context.Context, cfg aws.Config, v types.Stac }) if err != nil { if !isErr(err, "ValidationError") && !isErr(err, "ResourceNotFoundException") { - return Resource{}, err + return models.Resource{}, err } template = &cloudformation.GetTemplateOutput{} } @@ -61,14 +62,14 @@ func cloudFormationStackHandle(ctx context.Context, cfg aws.Config, v types.Stac }) if err != nil { if !isErr(err, "ValidationError") && !isErr(err, "ResourceNotFoundException") { - return Resource{}, err + return models.Resource{}, err } stackResources = &cloudformation.DescribeStackResourcesOutput{} } template.TemplateBody = nil - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.StackId, Name: *v.StackName, @@ -80,7 +81,7 @@ func cloudFormationStackHandle(ctx context.Context, cfg aws.Config, v types.Stac } return resource, nil } -func GetCloudFormationStack(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFormationStack(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { stackName := fields["name"] client := cloudformation.NewFromConfig(cfg) out, err := client.DescribeStacks(ctx, &cloudformation.DescribeStacksInput{ @@ -92,7 +93,7 @@ func GetCloudFormationStack(ctx context.Context, cfg aws.Config, fields map[stri } return nil, err } - var values []Resource + var values []models.Resource for _, stack := range out.Stacks { resource, err := cloudFormationStackHandle(ctx, cfg, stack) if err != nil { @@ -103,11 +104,11 @@ func GetCloudFormationStack(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func CloudFormationStackSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFormationStackSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudformation.NewFromConfig(cfg) paginator := cloudformation.NewListStackSetsPaginator(client, &cloudformation.ListStackSetsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -131,14 +132,14 @@ func CloudFormationStackSet(ctx context.Context, cfg aws.Config, stream *StreamS } return values, nil } -func cloudFormationStackSetHandle(ctx context.Context, cfg aws.Config, stackName string) (Resource, error) { +func cloudFormationStackSetHandle(ctx context.Context, cfg aws.Config, stackName string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudformation.NewFromConfig(cfg) stackSet, err := client.DescribeStackSet(ctx, &cloudformation.DescribeStackSetInput{ StackSetName: &stackName, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } if stackSet.StackSet.TemplateBody != nil && len(*stackSet.StackSet.TemplateBody) > 5000 { @@ -146,7 +147,7 @@ func cloudFormationStackSetHandle(ctx context.Context, cfg aws.Config, stackName stackSet.StackSet.TemplateBody = aws.String(v[:5000]) } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *stackSet.StackSet.StackSetARN, Name: *stackSet.StackSet.StackSetName, @@ -156,10 +157,10 @@ func cloudFormationStackSetHandle(ctx context.Context, cfg aws.Config, stackName } return resource, nil } -func GetCloudFormationStackSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFormationStackSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { stackName := fields["name"] - var values []Resource + var values []models.Resource resource, err := cloudFormationStackSetHandle(ctx, cfg, stackName) if err != nil { return nil, err @@ -169,11 +170,11 @@ func GetCloudFormationStackSet(ctx context.Context, cfg aws.Config, fields map[s return values, nil } -func CloudFormationStackResource(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFormationStackResource(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudformation.NewFromConfig(cfg) paginator := cloudformation.NewDescribeStacksPaginator(client, &cloudformation.DescribeStacksInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -211,7 +212,7 @@ func CloudFormationStackResource(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func cloudFormationStackResourceHandle(ctx context.Context, cfg aws.Config, stackName string, resourceId string) (Resource, error) { +func cloudFormationStackResourceHandle(ctx context.Context, cfg aws.Config, stackName string, resourceId string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudformation.NewFromConfig(cfg) @@ -221,11 +222,11 @@ func cloudFormationStackResourceHandle(ctx context.Context, cfg aws.Config, stac }) if err != nil { if !isErr(err, "ValidationError") && !isErr(err, "ResourceNotFoundException") { - return Resource{}, err + return models.Resource{}, err } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *stackResource.StackResourceDetail.LogicalResourceId, Description: model.CloudFormationStackResourceDescription{ @@ -234,7 +235,7 @@ func cloudFormationStackResourceHandle(ctx context.Context, cfg aws.Config, stac } return resource, nil } -func GetCloudFormationStackResource(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFormationStackResource(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { stackName := fields["stack_name"] LogicalResourceId := fields["logical_resource_id"] @@ -243,5 +244,5 @@ func GetCloudFormationStackResource(ctx context.Context, cfg aws.Config, fields return nil, err } - return []Resource{resource}, nil + return []models.Resource{resource}, nil } diff --git a/provider/describer/cloudfront.go b/provider/describer/cloudfront.go index b572171a..e16eb61c 100755 --- a/provider/describer/cloudfront.go +++ b/provider/describer/cloudfront.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudfront" @@ -10,11 +11,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func CloudFrontDistribution(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFrontDistribution(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) paginator := cloudfront.NewListDistributionsPaginator(client, &cloudfront.ListDistributionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -49,9 +50,9 @@ func CloudFrontDistribution(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func cloudFrontDistributionHandle(ctx context.Context, tags *cloudfront.ListTagsForResourceOutput, distribution *cloudfront.GetDistributionOutput, ARN *string, Id *string) Resource { +func cloudFrontDistributionHandle(ctx context.Context, tags *cloudfront.ListTagsForResourceOutput, distribution *cloudfront.GetDistributionOutput, ARN *string, Id *string) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *ARN, Name: *Id, @@ -63,10 +64,10 @@ func cloudFrontDistributionHandle(ctx context.Context, tags *cloudfront.ListTags } return resource } -func GetCloudFrontDistribution(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFrontDistribution(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) id := fields["id"] - var values []Resource + var values []models.Resource DistributionData, err := client.GetDistribution(ctx, &cloudfront.GetDistributionInput{ Id: &id, @@ -102,12 +103,12 @@ func GetCloudFrontDistribution(ctx context.Context, cfg aws.Config, fields map[s return values, nil } -func CloudFrontStreamingDistribution(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFrontStreamingDistribution(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudfront.NewFromConfig(cfg) paginator := cloudfront.NewListStreamingDistributionsPaginator(client, &cloudfront.ListStreamingDistributionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -129,7 +130,7 @@ func CloudFrontStreamingDistribution(ctx context.Context, cfg aws.Config, stream return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ARN, Name: *item.Id, @@ -152,10 +153,10 @@ func CloudFrontStreamingDistribution(ctx context.Context, cfg aws.Config, stream return values, nil } -func CloudFrontOriginAccessControl(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFrontOriginAccessControl(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListOriginAccessControls(ctx, &cloudfront.ListOriginAccessControlsInput{ Marker: prevToken, @@ -183,7 +184,7 @@ func CloudFrontOriginAccessControl(ctx context.Context, cfg aws.Config, stream * return values, nil } -func cloudFrontOriginAccessControlHandle(ctx context.Context, cfg aws.Config, v types.OriginAccessControlSummary) Resource { +func cloudFrontOriginAccessControlHandle(ctx context.Context, cfg aws.Config, v types.OriginAccessControlSummary) models.Resource { describeCtx := GetDescribeContext(ctx) client := cloudfront.NewFromConfig(cfg) @@ -197,7 +198,7 @@ func cloudFrontOriginAccessControlHandle(ctx context.Context, cfg aws.Config, v tags = tagsOutput.Tags.Items } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.Id, @@ -208,11 +209,11 @@ func cloudFrontOriginAccessControlHandle(ctx context.Context, cfg aws.Config, v } return resource } -func GetCloudFrontOriginAccessControl(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFrontOriginAccessControl(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) id := fields["id"] - var values []Resource + var values []models.Resource out, err := client.GetOriginAccessControl(ctx, &cloudfront.GetOriginAccessControlInput{ Id: &id, }) @@ -236,10 +237,10 @@ func GetCloudFrontOriginAccessControl(ctx context.Context, cfg aws.Config, field return values, nil } -func CloudFrontCachePolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFrontCachePolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListCachePolicies(ctx, &cloudfront.ListCachePoliciesInput{ Marker: prevToken, @@ -276,10 +277,10 @@ func CloudFrontCachePolicy(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func cloudFrontCachePolicyHandle(ctx context.Context, cachePolicy *cloudfront.GetCachePolicyOutput, id string) Resource { +func cloudFrontCachePolicyHandle(ctx context.Context, cachePolicy *cloudfront.GetCachePolicyOutput, id string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:cloudfront::%s:cache-policy/%s", describeCtx.Partition, describeCtx.AccountID, id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: id, @@ -289,10 +290,10 @@ func cloudFrontCachePolicyHandle(ctx context.Context, cachePolicy *cloudfront.Ge } return resource } -func GetCloudFrontCachePolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFrontCachePolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) id := fields["id"] - var values []Resource + var values []models.Resource cachePolicy, err := client.GetCachePolicy(ctx, &cloudfront.GetCachePolicyInput{ Id: &id, }) @@ -307,10 +308,10 @@ func GetCloudFrontCachePolicy(ctx context.Context, cfg aws.Config, fields map[st return values, nil } -func CloudFrontFunction(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFrontFunction(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListFunctions(ctx, &cloudfront.ListFunctionsInput{ Marker: prevToken, @@ -346,10 +347,10 @@ func CloudFrontFunction(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func cloudFrontFunctionHandle(ctx context.Context, function *cloudfront.DescribeFunctionOutput) Resource { +func cloudFrontFunctionHandle(ctx context.Context, function *cloudfront.DescribeFunctionOutput) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *function.FunctionSummary.FunctionMetadata.FunctionARN, Name: *function.FunctionSummary.Name, @@ -359,11 +360,11 @@ func cloudFrontFunctionHandle(ctx context.Context, function *cloudfront.Describe } return resource } -func GetCloudFrontFunction(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFrontFunction(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) name := fields["name"] - var values []Resource + var values []models.Resource function, err := client.DescribeFunction(ctx, &cloudfront.DescribeFunctionInput{ Name: &name, }) @@ -378,9 +379,9 @@ func GetCloudFrontFunction(ctx context.Context, cfg aws.Config, fields map[strin return values, nil } -func CloudFrontOriginAccessIdentity(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFrontOriginAccessIdentity(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := cloudfront.NewListCloudFrontOriginAccessIdentitiesPaginator(client, &cloudfront.ListCloudFrontOriginAccessIdentitiesInput{}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -408,11 +409,11 @@ func CloudFrontOriginAccessIdentity(ctx context.Context, cfg aws.Config, stream } return values, nil } -func cloudFrontOriginAccessIdentityHandle(ctx context.Context, originAccessIdentity *cloudfront.GetCloudFrontOriginAccessIdentityOutput, id string) Resource { +func cloudFrontOriginAccessIdentityHandle(ctx context.Context, originAccessIdentity *cloudfront.GetCloudFrontOriginAccessIdentityOutput, id string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:cloudfront::%s:origin-access-identity/%s", describeCtx.Partition, describeCtx.AccountID, id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: id, @@ -422,10 +423,10 @@ func cloudFrontOriginAccessIdentityHandle(ctx context.Context, originAccessIdent } return resource } -func GetCloudFrontOriginAccessIdentity(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFrontOriginAccessIdentity(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) id := fields["id"] - var values []Resource + var values []models.Resource originAccessIdentity, err := client.GetCloudFrontOriginAccessIdentity(ctx, &cloudfront.GetCloudFrontOriginAccessIdentityInput{ Id: &id, @@ -439,9 +440,9 @@ func GetCloudFrontOriginAccessIdentity(ctx context.Context, cfg aws.Config, fiel return values, nil } -func CloudFrontOriginRequestPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFrontOriginRequestPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListOriginRequestPolicies(ctx, &cloudfront.ListOriginRequestPoliciesInput{ Marker: prevToken, @@ -479,11 +480,11 @@ func CloudFrontOriginRequestPolicy(ctx context.Context, cfg aws.Config, stream * return values, nil } -func cloudFrontOriginRequestPolicyHandle(ctx context.Context, policy *cloudfront.GetOriginRequestPolicyOutput, id string) Resource { +func cloudFrontOriginRequestPolicyHandle(ctx context.Context, policy *cloudfront.GetOriginRequestPolicyOutput, id string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:cloudfront::%s:origin-request-policy/%s", describeCtx.Partition, describeCtx.AccountID, &id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *policy.OriginRequestPolicy.Id, @@ -493,9 +494,9 @@ func cloudFrontOriginRequestPolicyHandle(ctx context.Context, policy *cloudfront } return resource } -func GetCloudFrontOriginRequestPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFrontOriginRequestPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] - var values []Resource + var values []models.Resource client := cloudfront.NewFromConfig(cfg) policy, err := client.GetOriginRequestPolicy(ctx, &cloudfront.GetOriginRequestPolicyInput{ @@ -514,9 +515,9 @@ func GetCloudFrontOriginRequestPolicy(ctx context.Context, cfg aws.Config, field return values, nil } -func CloudFrontResponseHeadersPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudFrontResponseHeadersPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudfront.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListResponseHeadersPolicies(ctx, &cloudfront.ListResponseHeadersPoliciesInput{ Marker: prevToken, @@ -552,11 +553,11 @@ func CloudFrontResponseHeadersPolicy(ctx context.Context, cfg aws.Config, stream return values, nil } -func cloudFrontResponseHeadersPolicyHandle(ctx context.Context, policy *cloudfront.GetResponseHeadersPolicyOutput, id *string) Resource { +func cloudFrontResponseHeadersPolicyHandle(ctx context.Context, policy *cloudfront.GetResponseHeadersPolicyOutput, id *string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:cloudfront::%s:response-headers-policy/%s", describeCtx.Partition, describeCtx.AccountID, *id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *policy.ResponseHeadersPolicy.Id, @@ -566,9 +567,9 @@ func cloudFrontResponseHeadersPolicyHandle(ctx context.Context, policy *cloudfro } return resource } -func GetCloudFrontResponseHeadersPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudFrontResponseHeadersPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] - var values []Resource + var values []models.Resource client := cloudfront.NewFromConfig(cfg) policy, err := client.GetResponseHeadersPolicy(ctx, &cloudfront.GetResponseHeadersPolicyInput{ diff --git a/provider/describer/cloudsearch.go b/provider/describer/cloudsearch.go index 997d48e4..b70f0130 100755 --- a/provider/describer/cloudsearch.go +++ b/provider/describer/cloudsearch.go @@ -4,15 +4,16 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/cloudsearch/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudsearch" "github.com/opengovern/og-describer-aws/provider/model" ) -func CloudSearchDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudSearchDomain(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudsearch.NewFromConfig(cfg) - var values []Resource + var values []models.Resource output, err := client.ListDomainNames(ctx, &cloudsearch.ListDomainNamesInput{}) if err != nil { @@ -43,9 +44,9 @@ func CloudSearchDomain(ctx context.Context, cfg aws.Config, stream *StreamSender } return values, nil } -func cloudSearchDomainHandle(ctx context.Context, domain types.DomainStatus) Resource { +func cloudSearchDomainHandle(ctx context.Context, domain types.DomainStatus) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *domain.ARN, Name: *domain.DomainName, @@ -56,11 +57,11 @@ func cloudSearchDomainHandle(ctx context.Context, domain types.DomainStatus) Res } return resource } -func GetCloudSearchDomain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudSearchDomain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { domainList := fields["domainList"] client := cloudsearch.NewFromConfig(cfg) - var values []Resource + var values []models.Resource domains, err := client.DescribeDomains(ctx, &cloudsearch.DescribeDomainsInput{ DomainNames: []string{domainList}, }) diff --git a/provider/describer/cloudtrail.go b/provider/describer/cloudtrail.go index 5bca5b28..4a7e68cf 100755 --- a/provider/describer/cloudtrail.go +++ b/provider/describer/cloudtrail.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -12,7 +13,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func CloudTrailTrail(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudTrailTrail(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudtrail.NewFromConfig(cfg) paginator := cloudtrail.NewListTrailsPaginator(client, &cloudtrail.ListTrailsInput{}) @@ -25,7 +26,7 @@ func CloudTrailTrail(ctx context.Context, cfg aws.Config, stream *StreamSender) // return nil, err //} - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -63,7 +64,7 @@ func CloudTrailTrail(ctx context.Context, cfg aws.Config, stream *StreamSender) for _, v := range output.TrailList { resource, err := cloudTrailTrailHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -83,7 +84,7 @@ func CloudTrailTrail(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func cloudTrailTrailHandle(ctx context.Context, cfg aws.Config, v types.Trail) (Resource, error) { +func cloudTrailTrailHandle(ctx context.Context, cfg aws.Config, v types.Trail) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudtrail.NewFromConfig(cfg) statusOutput, err := client.GetTrailStatus(ctx, &cloudtrail.GetTrailStatusInput{ @@ -91,9 +92,9 @@ func cloudTrailTrailHandle(ctx context.Context, cfg aws.Config, v types.Trail) ( }) if err != nil { if isErr(err, "GetTrailStatusNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } selectorOutput, err := client.GetEventSelectors(ctx, &cloudtrail.GetEventSelectorsInput{ @@ -101,9 +102,9 @@ func cloudTrailTrailHandle(ctx context.Context, cfg aws.Config, v types.Trail) ( }) if err != nil { if isErr(err, "GetEventSelectorsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } tagsOutput, err := client.ListTags(ctx, &cloudtrail.ListTagsInput{ @@ -111,9 +112,9 @@ func cloudTrailTrailHandle(ctx context.Context, cfg aws.Config, v types.Trail) ( }) if err != nil { if isErr(err, "ListTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } var tags []types.Tag @@ -121,7 +122,7 @@ func cloudTrailTrailHandle(ctx context.Context, cfg aws.Config, v types.Trail) ( tags = tagsOutput.ResourceTagList[0].TagsList } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TrailARN, Name: *v.Name, @@ -135,7 +136,7 @@ func cloudTrailTrailHandle(ctx context.Context, cfg aws.Config, v types.Trail) ( } return resource, nil } -func GetCloudTrailTrail(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudTrailTrail(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := cloudtrail.NewFromConfig(cfg) @@ -185,10 +186,10 @@ func GetCloudTrailTrail(ctx context.Context, cfg aws.Config, fields map[string]s return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.TrailList { resource, err := cloudTrailTrailHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -201,12 +202,12 @@ func GetCloudTrailTrail(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func CloudTrailChannel(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudTrailChannel(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudtrail.NewFromConfig(cfg) paginator := cloudtrail.NewListChannelsPaginator(client, &cloudtrail.ListChannelsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -221,7 +222,7 @@ func CloudTrailChannel(ctx context.Context, cfg aws.Config, stream *StreamSender return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *channel.ChannelArn, Name: *channel.Name, @@ -242,11 +243,11 @@ func CloudTrailChannel(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func CloudTrailEventDataStore(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudTrailEventDataStore(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := cloudtrail.NewFromConfig(cfg) paginator := cloudtrail.NewListEventDataStoresPaginator(client, &cloudtrail.ListEventDataStoresInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -255,7 +256,7 @@ func CloudTrailEventDataStore(ctx context.Context, cfg aws.Config, stream *Strea for _, eventDataStore := range page.EventDataStores { resource, err := cloudTrailEventDataStoreHandle(ctx, cfg, eventDataStore) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -274,7 +275,7 @@ func CloudTrailEventDataStore(ctx context.Context, cfg aws.Config, stream *Strea } return values, nil } -func cloudTrailEventDataStoreHandle(ctx context.Context, cfg aws.Config, eventDataStore types.EventDataStore) (Resource, error) { +func cloudTrailEventDataStoreHandle(ctx context.Context, cfg aws.Config, eventDataStore types.EventDataStore) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudtrail.NewFromConfig(cfg) @@ -283,12 +284,12 @@ func cloudTrailEventDataStoreHandle(ctx context.Context, cfg aws.Config, eventDa }) if err != nil { if isErr(err, "GetEventDataStoreNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *eventDataStore.EventDataStoreArn, Name: *eventDataStore.Name, @@ -298,7 +299,7 @@ func cloudTrailEventDataStoreHandle(ctx context.Context, cfg aws.Config, eventDa } return resource, nil } -func GetCloudTrailEventDataStore(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudTrailEventDataStore(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { eventDataStoreName := fields["name"] client := cloudtrail.NewFromConfig(cfg) @@ -310,14 +311,14 @@ func GetCloudTrailEventDataStore(ctx context.Context, cfg aws.Config, fields map return nil, err } - var values []Resource + var values []models.Resource for _, evenDataStore := range out.EventDataStores { if !strings.EqualFold(eventDataStoreName, *evenDataStore.Name) { continue } resource, err := cloudTrailEventDataStoreHandle(ctx, cfg, evenDataStore) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -330,12 +331,12 @@ func GetCloudTrailEventDataStore(ctx context.Context, cfg aws.Config, fields map return values, nil } -func CloudTrailImport(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudTrailImport(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudtrail.NewFromConfig(cfg) paginator := cloudtrail.NewListImportsPaginator(client, &cloudtrail.ListImportsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -356,7 +357,7 @@ func CloudTrailImport(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *trailImport.ImportId, Description: model.CloudTrailImportDescription{ @@ -376,12 +377,12 @@ func CloudTrailImport(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func CloudTrailQuery(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudTrailQuery(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudtrail.NewFromConfig(cfg) paginator := cloudtrail.NewListEventDataStoresPaginator(client, &cloudtrail.ListEventDataStoresInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -405,7 +406,7 @@ func CloudTrailQuery(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *query.QueryId, Description: model.CloudTrailQueryDescription{ @@ -428,7 +429,7 @@ func CloudTrailQuery(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func CloudTrailTrailEvent(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudTrailTrailEvent(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) @@ -437,7 +438,7 @@ func CloudTrailTrailEvent(ctx context.Context, cfg aws.Config, stream *StreamSen return nil, err } - var values []Resource + var values []models.Resource for _, logGroup := range logGroups { paginator := cloudwatchlogs.NewFilterLogEventsPaginator(client, &cloudwatchlogs.FilterLogEventsInput{ LogGroupName: logGroup.Description.(model.CloudWatchLogsLogGroupDescription).LogGroup.LogGroupName, @@ -454,7 +455,7 @@ func CloudTrailTrailEvent(ctx context.Context, cfg aws.Config, stream *StreamSen } for _, event := range page.Events { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *event.EventId, Description: model.CloudTrailTrailEventDescription{ diff --git a/provider/describer/cloudwatch.go b/provider/describer/cloudwatch.go index d296f46b..d418b01f 100755 --- a/provider/describer/cloudwatch.go +++ b/provider/describer/cloudwatch.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "time" @@ -14,14 +15,14 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func CloudWatchAlarm(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchAlarm(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatch.NewFromConfig(cfg) paginator := cloudwatch.NewDescribeAlarmsPaginator(client, &cloudwatch.DescribeAlarmsInput{ AlarmTypes: []types.AlarmType{types.AlarmTypeMetricAlarm}, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -36,7 +37,7 @@ func CloudWatchAlarm(ctx context.Context, cfg aws.Config, stream *StreamSender) tags = &cloudwatch.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AlarmArn, Name: *v.AlarmName, @@ -58,7 +59,7 @@ func CloudWatchAlarm(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func GetCloudWatchAlarm(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCloudWatchAlarm(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) alarmName := fields["name"] client := cloudwatch.NewFromConfig(cfg) @@ -69,7 +70,7 @@ func GetCloudWatchAlarm(ctx context.Context, cfg aws.Config, fields map[string]s return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.MetricAlarms { tags, err := client.ListTagsForResource(ctx, &cloudwatch.ListTagsForResourceInput{ ResourceARN: v.AlarmArn, @@ -78,7 +79,7 @@ func GetCloudWatchAlarm(ctx context.Context, cfg aws.Config, fields map[string]s tags = &cloudwatch.ListTagsForResourceOutput{} } - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AlarmArn, Name: *v.AlarmName, @@ -92,7 +93,7 @@ func GetCloudWatchAlarm(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func CloudWatchAnomalyDetector(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchAnomalyDetector(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatch.NewFromConfig(cfg) output, err := client.DescribeAnomalyDetectors(ctx, &cloudwatch.DescribeAnomalyDetectorsInput{}) @@ -100,9 +101,9 @@ func CloudWatchAnomalyDetector(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.AnomalyDetectors { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*v.SingleMetricAnomalyDetector.Namespace, *v.SingleMetricAnomalyDetector.MetricName), Name: *v.SingleMetricAnomalyDetector.MetricName, @@ -120,14 +121,14 @@ func CloudWatchAnomalyDetector(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func CloudWatchCompositeAlarm(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchCompositeAlarm(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatch.NewFromConfig(cfg) paginator := cloudwatch.NewDescribeAlarmsPaginator(client, &cloudwatch.DescribeAlarmsInput{ AlarmTypes: []types.AlarmType{types.AlarmTypeCompositeAlarm}, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -135,7 +136,7 @@ func CloudWatchCompositeAlarm(ctx context.Context, cfg aws.Config, stream *Strea } for _, v := range page.MetricAlarms { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AlarmArn, Name: *v.AlarmName, @@ -154,7 +155,7 @@ func CloudWatchCompositeAlarm(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func CloudWatchDashboard(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchDashboard(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatch.NewFromConfig(cfg) output, err := client.ListDashboards(ctx, &cloudwatch.ListDashboardsInput{}) @@ -162,9 +163,9 @@ func CloudWatchDashboard(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.DashboardEntries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DashboardArn, Name: *v.DashboardName, @@ -182,12 +183,12 @@ func CloudWatchDashboard(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func CloudWatchInsightRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchInsightRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatch.NewFromConfig(cfg) paginator := cloudwatch.NewDescribeInsightRulesPaginator(client, &cloudwatch.DescribeInsightRulesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -195,7 +196,7 @@ func CloudWatchInsightRule(ctx context.Context, cfg aws.Config, stream *StreamSe } for _, v := range page.InsightRules { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Name, Name: *v.Name, @@ -214,7 +215,7 @@ func CloudWatchInsightRule(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func CloudWatchMetricStream(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchMetricStream(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatch.NewFromConfig(cfg) output, err := client.ListMetricStreams(ctx, &cloudwatch.ListMetricStreamsInput{}) @@ -222,9 +223,9 @@ func CloudWatchMetricStream(ctx context.Context, cfg aws.Config, stream *StreamS return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.Entries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, @@ -242,12 +243,12 @@ func CloudWatchMetricStream(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func CloudWatchLogsDestination(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchLogsDestination(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) paginator := cloudwatchlogs.NewDescribeDestinationsPaginator(client, &cloudwatchlogs.DescribeDestinationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -255,7 +256,7 @@ func CloudWatchLogsDestination(ctx context.Context, cfg aws.Config, stream *Stre } for _, v := range page.Destinations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.DestinationName, @@ -274,12 +275,12 @@ func CloudWatchLogsDestination(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func CloudWatchLogsLogGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchLogsLogGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) paginator := cloudwatchlogs.NewDescribeLogGroupsPaginator(client, &cloudwatchlogs.DescribeLogGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -305,7 +306,7 @@ func CloudWatchLogsLogGroup(ctx context.Context, cfg aws.Config, stream *StreamS return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.LogGroupName, @@ -328,12 +329,12 @@ func CloudWatchLogsLogGroup(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func CloudWatchLogsMetricFilter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchLogsMetricFilter(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) paginator := cloudwatchlogs.NewDescribeMetricFiltersPaginator(client, &cloudwatchlogs.DescribeMetricFiltersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -342,7 +343,7 @@ func CloudWatchLogsMetricFilter(ctx context.Context, cfg aws.Config, stream *Str for _, v := range page.MetricFilters { arn := "arn:" + describeCtx.Partition + ":logs:" + describeCtx.Region + ":" + describeCtx.AccountID + ":log-group:" + *v.LogGroupName + ":metric-filter:" + *v.FilterName - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *v.FilterName, @@ -364,11 +365,11 @@ func CloudWatchLogsMetricFilter(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func CloudWatchLogsQueryDefinition(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchLogsQueryDefinition(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeQueryDefinitions(ctx, &cloudwatchlogs.DescribeQueryDefinitionsInput{NextToken: prevToken}) if err != nil { @@ -376,7 +377,7 @@ func CloudWatchLogsQueryDefinition(ctx context.Context, cfg aws.Config, stream * } for _, v := range output.QueryDefinitions { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.QueryDefinitionId, Name: *v.Name, @@ -401,14 +402,14 @@ func CloudWatchLogsQueryDefinition(ctx context.Context, cfg aws.Config, stream * return values, nil } -func CloudWatchLogEvent(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchLogEvent(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) logGroups, err := CloudWatchLogsLogGroup(ctx, cfg, nil) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, logGroup := range logGroups { logGroupName := logGroup.Description.(model.CloudWatchLogsLogGroupDescription).LogGroup.LogGroupName paginator := cloudwatchlogs.NewFilterLogEventsPaginator(client, &cloudwatchlogs.FilterLogEventsInput{ @@ -426,7 +427,7 @@ func CloudWatchLogEvent(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, v := range page.Events { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.EventId, Name: *v.LogStreamName, @@ -449,11 +450,11 @@ func CloudWatchLogEvent(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func CloudWatchLogsResourcePolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchLogsResourcePolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeResourcePolicies(ctx, &cloudwatchlogs.DescribeResourcePoliciesInput{ NextToken: prevToken, @@ -463,7 +464,7 @@ func CloudWatchLogsResourcePolicy(ctx context.Context, cfg aws.Config, stream *S } for _, v := range output.ResourcePolicies { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *v.PolicyName, Description: model.CloudWatchLogResourcePolicyDescription{ @@ -489,7 +490,7 @@ func CloudWatchLogsResourcePolicy(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func CloudWatchLogStream(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchLogStream(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) logGroups, err := CloudWatchLogsLogGroup(ctx, cfg, nil) @@ -497,7 +498,7 @@ func CloudWatchLogStream(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - var values []Resource + var values []models.Resource for _, logGroup := range logGroups { logGroupName := logGroup.Description.(model.CloudWatchLogsLogGroupDescription).LogGroup.LogGroupName paginator := cloudwatchlogs.NewDescribeLogStreamsPaginator(client, &cloudwatchlogs.DescribeLogStreamsInput{ @@ -518,7 +519,7 @@ func CloudWatchLogStream(ctx context.Context, cfg aws.Config, stream *StreamSend } for _, v := range page.LogStreams { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.LogStreamName, @@ -541,13 +542,13 @@ func CloudWatchLogStream(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func CloudWatchLogsSubscriptionFilter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchLogsSubscriptionFilter(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatchlogs.NewFromConfig(cfg) logGroupPaginator := cloudwatchlogs.NewDescribeLogGroupsPaginator(client, &cloudwatchlogs.DescribeLogGroupsInput{}) - var values []Resource + var values []models.Resource for logGroupPaginator.HasMorePages() { logGroupPage, err := logGroupPaginator.NextPage(ctx) if err != nil { @@ -568,7 +569,7 @@ func CloudWatchLogsSubscriptionFilter(ctx context.Context, cfg aws.Config, strea for _, v := range page.SubscriptionFilters { arn := fmt.Sprintf("arn:%s:logs:%s:%s:log-group:%s:subscription-filter:%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *logGroupName, *v.FilterName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*v.LogGroupName, *v.FilterName), ARN: arn, @@ -593,12 +594,12 @@ func CloudWatchLogsSubscriptionFilter(ctx context.Context, cfg aws.Config, strea return values, nil } -func CloudWatchMetrics(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchMetrics(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatch.NewFromConfig(cfg) paginator := cloudwatch.NewListMetricsPaginator(client, &cloudwatch.ListMetricsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -606,7 +607,7 @@ func CloudWatchMetrics(ctx context.Context, cfg aws.Config, stream *StreamSender } for _, v := range page.Metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *v.MetricName, Description: model.CloudWatchMetricDescription{ @@ -707,12 +708,12 @@ func listCloudWatchMetricStatistics(ctx context.Context, cfg aws.Config, granula return values, nil } -func CloudWatchMetricDataPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CloudWatchMetricDataPoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := cloudwatch.NewFromConfig(cfg) paginator := cloudwatch.NewDescribeAnomalyDetectorsPaginator(client, &cloudwatch.DescribeAnomalyDetectorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -732,7 +733,7 @@ func CloudWatchMetricDataPoint(ctx context.Context, cfg aws.Config, stream *Stre } for _, r := range metricsPage.MetricDataResults { for item := 0; item < len(r.Timestamps); item++ { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *r.Id, Description: model.CloudWatchMetricDataPointDescription{ @@ -760,12 +761,12 @@ func CloudWatchMetricDataPoint(ctx context.Context, cfg aws.Config, stream *Stre } // -//func CloudWatchMetricStatisticDataPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +//func CloudWatchMetricStatisticDataPoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { // describeCtx := GetDescribeContext(ctx) // client := cloudwatch.NewFromConfig(cfg) // paginator := cloudwatch.NewDescribeAnomalyDetectorsPaginator(client, &cloudwatch.DescribeAnomalyDetectorsInput{}) // -// var values []Resource +// var values []models.Resource // for paginator.HasMorePages() { // page, err := paginator.NextPage(ctx) // if err != nil { @@ -792,7 +793,7 @@ func CloudWatchMetricDataPoint(ctx context.Context, cfg aws.Config, stream *Stre // } // for _, r := range metricsPage.MetricDataResults { // for item := 0; item < len(r.Timestamps); item++ { -// resource := Resource{ +// resource := models.Resource{ // Region: describeCtx.OGRegion, // ID: *r.Id, // Description: model.CloudWatchMetricDataPointDescription{ diff --git a/provider/describer/codeartifact.go b/provider/describer/codeartifact.go index 28a8ec4c..49ccf11a 100755 --- a/provider/describer/codeartifact.go +++ b/provider/describer/codeartifact.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -10,11 +11,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func CodeArtifactRepository(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeArtifactRepository(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := codeartifact.NewFromConfig(cfg) paginator := codeartifact.NewListRepositoriesPaginator(client, &codeartifact.ListRepositoriesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -26,7 +27,7 @@ func CodeArtifactRepository(ctx context.Context, cfg aws.Config, stream *StreamS if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -43,7 +44,7 @@ func CodeArtifactRepository(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func codeArtifactRepositoryHandle(ctx context.Context, cfg aws.Config, v types.RepositorySummary) (Resource, error) { +func codeArtifactRepositoryHandle(ctx context.Context, cfg aws.Config, v types.RepositorySummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := codeartifact.NewFromConfig(cfg) @@ -52,9 +53,9 @@ func codeArtifactRepositoryHandle(ctx context.Context, cfg aws.Config, v types.R }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } var policy types.ResourcePolicy policyOutput, err := client.GetRepositoryPermissionsPolicy(ctx, &codeartifact.GetRepositoryPermissionsPolicyInput{ @@ -67,9 +68,9 @@ func codeArtifactRepositoryHandle(ctx context.Context, cfg aws.Config, v types.R policy = types.ResourcePolicy{} } else { if isErr(err, "GetRepositoryPermissionsPolicyNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } } else { policy = *policyOutput.Policy @@ -81,9 +82,9 @@ func codeArtifactRepositoryHandle(ctx context.Context, cfg aws.Config, v types.R }) if err != nil { if isErr(err, "DescribeRepositoryNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } resultData := []string{} @@ -99,18 +100,18 @@ func codeArtifactRepositoryHandle(ctx context.Context, cfg aws.Config, v types.R } if err != nil { - return Resource{}, err + return models.Resource{}, err } data, err := client.GetRepositoryEndpoint(ctx, params) if err != nil { - return Resource{}, err + return models.Resource{}, err } resultData = append(resultData, *data.RepositoryEndpoint) } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, @@ -124,7 +125,7 @@ func codeArtifactRepositoryHandle(ctx context.Context, cfg aws.Config, v types.R } return resource, nil } -func GetCodeArtifactRepository(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCodeArtifactRepository(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { repository := fields["repository"] client := codeartifact.NewFromConfig(cfg) @@ -147,13 +148,13 @@ func GetCodeArtifactRepository(ctx context.Context, cfg aws.Config, fields map[s Name: out.Repository.Name, } - var values []Resource + var values []models.Resource resource, err := codeArtifactRepositoryHandle(ctx, cfg, Repo) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -162,11 +163,11 @@ func GetCodeArtifactRepository(ctx context.Context, cfg aws.Config, fields map[s return values, nil } -func CodeArtifactDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeArtifactDomain(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := codeartifact.NewFromConfig(cfg) paginator := codeartifact.NewListDomainsPaginator(client, &codeartifact.ListDomainsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -178,7 +179,7 @@ func CodeArtifactDomain(ctx context.Context, cfg aws.Config, stream *StreamSende if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -195,7 +196,7 @@ func CodeArtifactDomain(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func CodeArtifactDomainHandle(ctx context.Context, cfg aws.Config, v types.DomainSummary) (Resource, error) { +func CodeArtifactDomainHandle(ctx context.Context, cfg aws.Config, v types.DomainSummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := codeartifact.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &codeartifact.ListTagsForResourceInput{ @@ -203,9 +204,9 @@ func CodeArtifactDomainHandle(ctx context.Context, cfg aws.Config, v types.Domai }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } domain, err := client.DescribeDomain(ctx, &codeartifact.DescribeDomainInput{ @@ -214,9 +215,9 @@ func CodeArtifactDomainHandle(ctx context.Context, cfg aws.Config, v types.Domai }) if err != nil { if isErr(err, "DescribeDomainNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } policy, err := client.GetDomainPermissionsPolicy(ctx, &codeartifact.GetDomainPermissionsPolicyInput{ @@ -227,11 +228,11 @@ func CodeArtifactDomainHandle(ctx context.Context, cfg aws.Config, v types.Domai if isErr(err, "ResourceNotFoundException") { policy = &codeartifact.GetDomainPermissionsPolicyOutput{} } else { - return Resource{}, err + return models.Resource{}, err } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Description: model.CodeArtifactDomainDescription{ @@ -246,7 +247,7 @@ func CodeArtifactDomainHandle(ctx context.Context, cfg aws.Config, v types.Domai return resource, nil } -func GetCodeArtifactDomain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCodeArtifactDomain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { domainName := fields["domainName"] client := codeartifact.NewFromConfig(cfg) domains, err := client.ListDomains(ctx, &codeartifact.ListDomainsInput{}) @@ -257,7 +258,7 @@ func GetCodeArtifactDomain(ctx context.Context, cfg aws.Config, fields map[strin return nil, err } - var values []Resource + var values []models.Resource for _, v := range domains.Domains { if *v.Name != domainName { continue @@ -267,7 +268,7 @@ func GetCodeArtifactDomain(ctx context.Context, cfg aws.Config, fields map[strin if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/codebuild.go b/provider/describer/codebuild.go index 1f66ed76..2283f4a9 100755 --- a/provider/describer/codebuild.go +++ b/provider/describer/codebuild.go @@ -4,17 +4,18 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/codebuild/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/codebuild" "github.com/opengovern/og-describer-aws/provider/model" ) -func CodeBuildProject(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeBuildProject(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := codebuild.NewFromConfig(cfg) paginator := codebuild.NewListProjectsPaginator(client, &codebuild.ListProjectsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -48,9 +49,9 @@ func CodeBuildProject(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func codeBuildProjectHandle(ctx context.Context, project types.Project) Resource { +func codeBuildProjectHandle(ctx context.Context, project types.Project) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *project.Arn, Name: *project.Name, @@ -60,7 +61,7 @@ func codeBuildProjectHandle(ctx context.Context, project types.Project) Resource } return resource } -func GetCodeBuildProject(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCodeBuildProject(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := codebuild.NewFromConfig(cfg) @@ -74,7 +75,7 @@ func GetCodeBuildProject(ctx context.Context, cfg aws.Config, fields map[string] return nil, err } - var values []Resource + var values []models.Resource for _, project := range out.Projects { resource := codeBuildProjectHandle(ctx, project) values = append(values, resource) @@ -82,14 +83,14 @@ func GetCodeBuildProject(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func CodeBuildSourceCredential(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeBuildSourceCredential(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := codebuild.NewFromConfig(cfg) out, err := client.ListSourceCredentials(ctx, &codebuild.ListSourceCredentialsInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, item := range out.SourceCredentialsInfos { resource := codeBuildSourceCredentialHandle(ctx, item) if stream != nil { @@ -102,9 +103,9 @@ func CodeBuildSourceCredential(ctx context.Context, cfg aws.Config, stream *Stre } return values, nil } -func codeBuildSourceCredentialHandle(ctx context.Context, item types.SourceCredentialsInfo) Resource { +func codeBuildSourceCredentialHandle(ctx context.Context, item types.SourceCredentialsInfo) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.Arn, Name: nameFromArn(*item.Arn), @@ -114,7 +115,7 @@ func codeBuildSourceCredentialHandle(ctx context.Context, item types.SourceCrede } return resource } -func GetCodeBuildSourceCredential(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCodeBuildSourceCredential(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] client := codebuild.NewFromConfig(cfg) credentials, err := client.ListSourceCredentials(ctx, &codebuild.ListSourceCredentialsInput{}) @@ -125,7 +126,7 @@ func GetCodeBuildSourceCredential(ctx context.Context, cfg aws.Config, fields ma return nil, err } - var values []Resource + var values []models.Resource for _, item := range credentials.SourceCredentialsInfos { if *item.Arn != arn { @@ -138,11 +139,11 @@ func GetCodeBuildSourceCredential(ctx context.Context, cfg aws.Config, fields ma return values, nil } -func CodeBuildBuild(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeBuildBuild(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := codebuild.NewFromConfig(cfg) paginator := codebuild.NewListBuildsPaginator(client, &codebuild.ListBuildsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -176,9 +177,9 @@ func CodeBuildBuild(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func codeBuildBuildHandle(ctx context.Context, build types.Build) Resource { +func codeBuildBuildHandle(ctx context.Context, build types.Build) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *build.Arn, ID: *build.Id, @@ -188,7 +189,7 @@ func codeBuildBuildHandle(ctx context.Context, build types.Build) Resource { } return resource } -func GetCodeBuildBuild(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCodeBuildBuild(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] client := codebuild.NewFromConfig(cfg) @@ -202,7 +203,7 @@ func GetCodeBuildBuild(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource for _, build := range out.Builds { resource := codeBuildBuildHandle(ctx, build) values = append(values, resource) diff --git a/provider/describer/codecommit.go b/provider/describer/codecommit.go index 4129986f..18e6baf8 100755 --- a/provider/describer/codecommit.go +++ b/provider/describer/codecommit.go @@ -5,17 +5,18 @@ import ( "math" "github.com/aws/aws-sdk-go-v2/service/codecommit/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/codecommit" "github.com/opengovern/og-describer-aws/provider/model" ) -func CodeCommitRepository(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeCommitRepository(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := codecommit.NewFromConfig(cfg) paginator := codecommit.NewListRepositoriesPaginator(client, &codecommit.ListRepositoriesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -61,7 +62,7 @@ func CodeCommitRepository(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func codeCommitRepositoryHandle(ctx context.Context, cfg aws.Config, v types.RepositoryMetadata) (Resource, error) { +func codeCommitRepositoryHandle(ctx context.Context, cfg aws.Config, v types.RepositoryMetadata) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := codecommit.NewFromConfig(cfg) @@ -70,12 +71,12 @@ func codeCommitRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Rep }) if err != nil { if !isErr(err, "InvalidParameter") { - return Resource{}, err + return models.Resource{}, err } tags = &codecommit.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.RepositoryName, @@ -86,9 +87,9 @@ func codeCommitRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Rep } return resource, nil } -func GetCodeCommitRepository(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCodeCommitRepository(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { repositoryName := fields["repositoryName"] - var values []Resource + var values []models.Resource client := codecommit.NewFromConfig(cfg) repos, err := client.BatchGetRepositories(ctx, &codecommit.BatchGetRepositoriesInput{ diff --git a/provider/describer/codedeploy.go b/provider/describer/codedeploy.go index d2d79ad2..0fe047d4 100755 --- a/provider/describer/codedeploy.go +++ b/provider/describer/codedeploy.go @@ -3,19 +3,20 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/codedeploy" "github.com/opengovern/og-describer-aws/provider/model" ) -func CodeDeployDeploymentGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeDeployDeploymentGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := codedeploy.NewFromConfig(cfg) paginator := codedeploy.NewListApplicationsPaginator(client, &codedeploy.ListApplicationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -52,7 +53,7 @@ func CodeDeployDeploymentGroup(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *deploymentGroup.DeploymentGroupInfo.DeploymentGroupName, @@ -76,13 +77,13 @@ func CodeDeployDeploymentGroup(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func CodeDeployApplication(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeDeployApplication(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := codedeploy.NewFromConfig(cfg) paginator := codedeploy.NewListApplicationsPaginator(client, &codedeploy.ListApplicationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -106,7 +107,7 @@ func CodeDeployApplication(ctx context.Context, cfg aws.Config, stream *StreamSe return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *application.Application.ApplicationName, @@ -128,13 +129,13 @@ func CodeDeployApplication(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func CodeDeployDeploymentConfig(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeDeployDeploymentConfig(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := codedeploy.NewFromConfig(cfg) paginator := codedeploy.NewListDeploymentConfigsPaginator(client, &codedeploy.ListDeploymentConfigsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -151,7 +152,7 @@ func CodeDeployDeploymentConfig(ctx context.Context, cfg aws.Config, stream *Str arn := fmt.Sprintf("arn:%s:codedeploy:%s:%s:deploymentconfig:%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *config.DeploymentConfigInfo.DeploymentConfigName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *config.DeploymentConfigInfo.DeploymentConfigName, diff --git a/provider/describer/codepipeline.go b/provider/describer/codepipeline.go index ca717fec..8ff0af56 100755 --- a/provider/describer/codepipeline.go +++ b/provider/describer/codepipeline.go @@ -2,17 +2,18 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/codepipeline" "github.com/opengovern/og-describer-aws/provider/model" ) -func CodePipelinePipeline(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodePipelinePipeline(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := codepipeline.NewFromConfig(cfg) paginator := codepipeline.NewListPipelinesPaginator(client, &codepipeline.ListPipelinesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -49,7 +50,7 @@ func CodePipelinePipeline(ctx context.Context, cfg aws.Config, stream *StreamSen } return values, nil } -func codePipelinePipelineHandle(ctx context.Context, cfg aws.Config, pipeline *codepipeline.GetPipelineOutput) (Resource, error) { +func codePipelinePipelineHandle(ctx context.Context, cfg aws.Config, pipeline *codepipeline.GetPipelineOutput) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := codepipeline.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &codepipeline.ListTagsForResourceInput{ @@ -57,12 +58,12 @@ func codePipelinePipelineHandle(ctx context.Context, cfg aws.Config, pipeline *c }) if err != nil { if !isErr(err, "InvalidParameter") { - return Resource{}, err + return models.Resource{}, err } tags = &codepipeline.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *pipeline.Metadata.PipelineArn, Name: *pipeline.Pipeline.Name, @@ -74,9 +75,9 @@ func codePipelinePipelineHandle(ctx context.Context, cfg aws.Config, pipeline *c } return resource, nil } -func GetCodePipelinePipeline(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetCodePipelinePipeline(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] - var values []Resource + var values []models.Resource client := codepipeline.NewFromConfig(cfg) pipeline, err := client.GetPipeline(ctx, &codepipeline.GetPipelineInput{ diff --git a/provider/describer/codestar.go b/provider/describer/codestar.go index b7df4d46..d7e08d61 100755 --- a/provider/describer/codestar.go +++ b/provider/describer/codestar.go @@ -2,17 +2,18 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/codestar" "github.com/opengovern/og-describer-aws/provider/model" ) -func CodeStarProject(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CodeStarProject(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := codestar.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { projects, err := client.ListProjects(ctx, &codestar.ListProjectsInput{ MaxResults: aws.Int32(100), @@ -37,7 +38,7 @@ func CodeStarProject(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *project.Arn, Name: *project.Id, diff --git a/provider/describer/config.go b/provider/describer/config.go index 8783b76c..a4f58ba3 100755 --- a/provider/describer/config.go +++ b/provider/describer/config.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/configservice" @@ -9,7 +10,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func ConfigConfigurationRecorder(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ConfigConfigurationRecorder(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := configservice.NewFromConfig(cfg) @@ -18,7 +19,7 @@ func ConfigConfigurationRecorder(ctx context.Context, cfg aws.Config, stream *St return nil, err } - var values []Resource + var values []models.Resource for _, item := range out.ConfigurationRecorders { status, err := client.DescribeConfigurationRecorderStatus(ctx, &configservice.DescribeConfigurationRecorderStatusInput{ ConfigurationRecorderNames: []string{*item.Name}, @@ -28,7 +29,7 @@ func ConfigConfigurationRecorder(ctx context.Context, cfg aws.Config, stream *St } arn := "arn:" + describeCtx.Partition + ":config:" + describeCtx.Region + ":" + describeCtx.AccountID + ":config-recorder" + "/" + *item.Name - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *item.Name, @@ -50,12 +51,12 @@ func ConfigConfigurationRecorder(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func ConfigAggregateAuthorization(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ConfigAggregateAuthorization(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := configservice.NewFromConfig(cfg) paginator := configservice.NewDescribeAggregationAuthorizationsPaginator(client, &configservice.DescribeAggregationAuthorizationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -69,7 +70,7 @@ func ConfigAggregateAuthorization(ctx context.Context, cfg aws.Config, stream *S return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.AggregationAuthorizationArn, ID: *item.AuthorizedAccountId, @@ -91,19 +92,19 @@ func ConfigAggregateAuthorization(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func ConfigConformancePack(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ConfigConformancePack(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := configservice.NewFromConfig(cfg) paginator := configservice.NewDescribeConformancePacksPaginator(client, &configservice.DescribeConformancePacksInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } for _, item := range page.ConformancePackDetails { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ConformancePackArn, ID: *item.ConformancePackId, @@ -125,12 +126,12 @@ func ConfigConformancePack(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func ConfigRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ConfigRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := configservice.NewFromConfig(cfg) paginator := configservice.NewDescribeConfigRulesPaginator(client, &configservice.DescribeConfigRulesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -161,7 +162,7 @@ func ConfigRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ConfigRuleArn, ID: *item.ConfigRuleId, @@ -186,19 +187,19 @@ func ConfigRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func ConfigRetentionConfiguration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ConfigRetentionConfiguration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := configservice.NewFromConfig(cfg) paginator := configservice.NewDescribeRetentionConfigurationsPaginator(client, &configservice.DescribeRetentionConfigurationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } for _, item := range page.RetentionConfigurations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *item.Name, Description: model.ConfigRetentionConfigurationDescription{ diff --git a/provider/describer/costexplorer.go b/provider/describer/costexplorer.go index 83ad1617..7a4542a1 100755 --- a/provider/describer/costexplorer.go +++ b/provider/describer/costexplorer.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strconv" "strings" "time" @@ -156,7 +157,7 @@ func costMonthly(ctx context.Context, cfg aws.Config, by string, startDate, endD return values, nil } -func CostByServiceLastMonth(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostByServiceLastMonth(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) triggerType := GetTriggerTypeFromContext(ctx) startDate := time.Now().AddDate(0, -1, 0) @@ -167,12 +168,12 @@ func CostByServiceLastMonth(ctx context.Context, cfg aws.Config, stream *StreamS if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, cost := range costs { if cost.Dimension1 == nil { continue } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "service-" + *cost.Dimension1 + "-cost-monthly", Description: model.CostExplorerByServiceMonthlyDescription{CostExplorerRow: cost}, @@ -189,7 +190,7 @@ func CostByServiceLastMonth(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func CostByAccountLastMonth(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostByAccountLastMonth(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) triggerType := GetTriggerTypeFromContext(ctx) startDate := time.Now().AddDate(0, -1, 0) @@ -201,12 +202,12 @@ func CostByAccountLastMonth(ctx context.Context, cfg aws.Config, stream *StreamS if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, cost := range costs { if cost.Dimension1 == nil { continue } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "account-" + *cost.Dimension1 + "-cost-monthly", Description: model.CostExplorerByAccountMonthlyDescription{CostExplorerRow: cost}, @@ -456,7 +457,7 @@ func ec2OtherCostDaily(ctx context.Context, cfg aws.Config, startDate, endDate t return values, nil } -func CostByServiceLastDay(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostByServiceLastDay(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) triggerType := GetTriggerTypeFromContext(ctx) startDate := time.Now().AddDate(0, 0, -7) @@ -476,7 +477,7 @@ func CostByServiceLastDay(ctx context.Context, cfg aws.Config, stream *StreamSen if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, cost := range costs { if cost.Dimension1 == nil || *cost.Dimension1 == "EC2 - Other" { continue @@ -494,7 +495,7 @@ func CostByServiceLastDay(ctx context.Context, cfg aws.Config, stream *StreamSen diff := tEnd.Sub(tStart) / 2 costDate := tStart.Add(diff) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "service-" + *cost.Dimension1 + "-cost-" + *cost.PeriodEnd, Description: model.CostExplorerByServiceDailyDescription{CostExplorerRow: cost, CostDateMillis: costDate.UnixMilli()}, @@ -529,7 +530,7 @@ func CostByServiceLastDay(ctx context.Context, cfg aws.Config, stream *StreamSen diff := tEnd.Sub(tStart) / 2 costDate := tStart.Add(diff) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "service-" + *cost.Dimension1 + "-cost-" + *cost.PeriodEnd, Description: model.CostExplorerByServiceDailyDescription{CostExplorerRow: cost, CostDateMillis: costDate.UnixMilli()}, @@ -546,7 +547,7 @@ func CostByServiceLastDay(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func CostByAccountLastDay(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostByAccountLastDay(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) triggerType := GetTriggerTypeFromContext(ctx) startDate := time.Now().AddDate(0, 0, -7) @@ -559,12 +560,12 @@ func CostByAccountLastDay(ctx context.Context, cfg aws.Config, stream *StreamSen if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, cost := range costs { if cost.Dimension1 == nil { continue } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "account-" + *cost.Dimension1 + "-cost-" + *cost.PeriodEnd, Description: model.CostExplorerByAccountDailyDescription{CostExplorerRow: cost}, @@ -618,7 +619,7 @@ func buildCostByRecordTypeInput(granularity string) *costexplorer.GetCostAndUsag return params } -func CostByRecordTypeLastMonth(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostByRecordTypeLastMonth(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := costexplorer.NewFromConfig(cfg) @@ -629,7 +630,7 @@ func CostByRecordTypeLastMonth(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } - var values []Resource + var values []models.Resource for _, result := range out.ResultsByTime { for _, group := range result.Groups { var row model.CostExplorerRow @@ -646,7 +647,7 @@ func CostByRecordTypeLastMonth(ctx context.Context, cfg aws.Config, stream *Stre } setRowMetrics(&row, group.Metrics) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "account-" + *row.Dimension1 + "-" + *row.Dimension2 + "-cost-monthly", Description: model.CostExplorerByRecordTypeMonthlyDescription{CostExplorerRow: row}, @@ -664,7 +665,7 @@ func CostByRecordTypeLastMonth(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func CostByRecordTypeLastDay(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostByRecordTypeLastDay(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := costexplorer.NewFromConfig(cfg) @@ -675,7 +676,7 @@ func CostByRecordTypeLastDay(ctx context.Context, cfg aws.Config, stream *Stream return nil, err } - var values []Resource + var values []models.Resource for _, result := range out.ResultsByTime { for _, group := range result.Groups { var row model.CostExplorerRow @@ -692,7 +693,7 @@ func CostByRecordTypeLastDay(ctx context.Context, cfg aws.Config, stream *Stream } setRowMetrics(&row, group.Metrics) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "account-" + *row.Dimension1 + "-" + *row.Dimension2 + "-cost-" + *row.PeriodEnd, Description: model.CostExplorerByRecordTypeDailyDescription{CostExplorerRow: row}, @@ -748,7 +749,7 @@ func buildCostByServiceAndUsageInput(granularity string) *costexplorer.GetCostAn return params } -func CostByServiceUsageLastMonth(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostByServiceUsageLastMonth(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := costexplorer.NewFromConfig(cfg) @@ -759,7 +760,7 @@ func CostByServiceUsageLastMonth(ctx context.Context, cfg aws.Config, stream *St return nil, err } - var values []Resource + var values []models.Resource for _, result := range out.ResultsByTime { for _, group := range result.Groups { var row model.CostExplorerRow @@ -776,7 +777,7 @@ func CostByServiceUsageLastMonth(ctx context.Context, cfg aws.Config, stream *St } setRowMetrics(&row, group.Metrics) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "service-" + *row.Dimension1 + "-" + *row.Dimension2 + "-cost-monthly", Description: model.CostExplorerByServiceUsageTypeMonthlyDescription{CostExplorerRow: row}, @@ -794,7 +795,7 @@ func CostByServiceUsageLastMonth(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func CostByServiceUsageLastDay(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostByServiceUsageLastDay(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := costexplorer.NewFromConfig(cfg) @@ -805,7 +806,7 @@ func CostByServiceUsageLastDay(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } - var values []Resource + var values []models.Resource for _, result := range out.ResultsByTime { for _, group := range result.Groups { var row model.CostExplorerRow @@ -822,7 +823,7 @@ func CostByServiceUsageLastDay(ctx context.Context, cfg aws.Config, stream *Stre } setRowMetrics(&row, group.Metrics) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "service-" + *row.Dimension1 + "-" + *row.Dimension2 + "-cost-" + *row.PeriodEnd, Description: model.CostExplorerByServiceUsageTypeDailyDescription{CostExplorerRow: row}, @@ -859,7 +860,7 @@ func buildCostForecastInput(granularity string) *costexplorer.GetCostForecastInp return params } -func CostForecastMonthly(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostForecastMonthly(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := costexplorer.NewFromConfig(cfg) @@ -868,9 +869,9 @@ func CostForecastMonthly(ctx context.Context, cfg aws.Config, stream *StreamSend if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, forecast := range output.ForecastResultsByTime { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "forecast-monthly", Description: model.CostExplorerForcastMonthlyDescription{CostExplorerRow: model.CostExplorerRow{ @@ -891,7 +892,7 @@ func CostForecastMonthly(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func CostForecastDaily(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func CostForecastDaily(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := costexplorer.NewFromConfig(cfg) @@ -900,9 +901,9 @@ func CostForecastDaily(ctx context.Context, cfg aws.Config, stream *StreamSender if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, forecast := range output.ForecastResultsByTime { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: "forecast-daily", Description: model.CostExplorerForcastDailyDescription{CostExplorerRow: model.CostExplorerRow{ diff --git a/provider/describer/dax.go b/provider/describer/dax.go index e20cb43c..e105d9fe 100755 --- a/provider/describer/dax.go +++ b/provider/describer/dax.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/service/dax/types" @@ -12,7 +13,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func DAXCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DAXCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dax.NewFromConfig(cfg) out, err := client.DescribeClusters(ctx, &dax.DescribeClustersInput{}) if err != nil { @@ -22,7 +23,7 @@ func DAXCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range out.Clusters { tags, err := client.ListTags(ctx, &dax.ListTagsInput{ ResourceName: cluster.ClusterArn, @@ -46,9 +47,9 @@ func DAXCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re } return values, nil } -func dAXClusterHandle(ctx context.Context, tags *dax.ListTagsOutput, cluster types.Cluster) Resource { +func dAXClusterHandle(ctx context.Context, tags *dax.ListTagsOutput, cluster types.Cluster) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *cluster.ClusterArn, Name: *cluster.ClusterName, @@ -59,9 +60,9 @@ func dAXClusterHandle(ctx context.Context, tags *dax.ListTagsOutput, cluster typ } return resource } -func GetDAXCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDAXCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterName := fields["name"] - var values []Resource + var values []models.Resource client := dax.NewFromConfig(cfg) clusterDescribe, err := client.DescribeClusters(ctx, &dax.DescribeClustersInput{ @@ -91,10 +92,10 @@ func GetDAXCluster(ctx context.Context, cfg aws.Config, fields map[string]string return values, nil } -func DAXParameterGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DAXParameterGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dax.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { parameterGroups, err := client.DescribeParameterGroups(ctx, &dax.DescribeParameterGroupsInput{ MaxResults: aws.Int32(100), @@ -125,9 +126,9 @@ func DAXParameterGroup(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func dAXParameterGroupHandle(ctx context.Context, parameterGroup types.ParameterGroup) Resource { +func dAXParameterGroupHandle(ctx context.Context, parameterGroup types.ParameterGroup) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *parameterGroup.ParameterGroupName, Description: model.DAXParameterGroupDescription{ @@ -136,9 +137,9 @@ func dAXParameterGroupHandle(ctx context.Context, parameterGroup types.Parameter } return resource } -func GetDAXParameterGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDAXParameterGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { parameterGroupName := fields["name"] - var values []Resource + var values []models.Resource client := dax.NewFromConfig(cfg) parameterGroups, err := client.DescribeParameterGroups(ctx, &dax.DescribeParameterGroupsInput{ @@ -157,12 +158,12 @@ func GetDAXParameterGroup(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func DAXParameter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DAXParameter(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) // client := dax.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { parameterGroups, err := client.DescribeParameterGroups(ctx, &dax.DescribeParameterGroupsInput{ MaxResults: aws.Int32(100), @@ -184,7 +185,7 @@ func DAXParameter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] } for _, parameter := range parameters.Parameters { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *parameter.ParameterName, Description: model.DAXParameterDescription{ @@ -218,11 +219,11 @@ func DAXParameter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func DAXSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DAXSubnetGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dax.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { subnetGroups, err := client.DescribeSubnetGroups(ctx, &dax.DescribeSubnetGroupsInput{ MaxResults: aws.Int32(100), @@ -252,11 +253,11 @@ func DAXSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func dAXSubnetGroupHandle(ctx context.Context, subnetGroup types.SubnetGroup) Resource { +func dAXSubnetGroupHandle(ctx context.Context, subnetGroup types.SubnetGroup) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:dax:%s::subnetgroup:%s", describeCtx.Partition, describeCtx.Region, *subnetGroup.SubnetGroupName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *subnetGroup.SubnetGroupName, ARN: arn, @@ -266,9 +267,9 @@ func dAXSubnetGroupHandle(ctx context.Context, subnetGroup types.SubnetGroup) Re } return resource } -func GetDAXSubnetGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDAXSubnetGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { SubnetGroupNames := fields["name"] - var values []Resource + var values []models.Resource client := dax.NewFromConfig(cfg) subnetGroups, err := client.DescribeSubnetGroups(ctx, &dax.DescribeSubnetGroupsInput{ diff --git a/provider/describer/directconnect.go b/provider/describer/directconnect.go index f7fe7786..e31a957f 100755 --- a/provider/describer/directconnect.go +++ b/provider/describer/directconnect.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "math" "github.com/aws/aws-sdk-go-v2/aws" @@ -11,14 +12,14 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func DirectConnectConnection(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DirectConnectConnection(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := directconnect.NewFromConfig(cfg) connections, err := client.DescribeConnections(ctx, &directconnect.DescribeConnectionsInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range connections.Connections { resource := directConnectConnectionHandle(ctx, v) if stream != nil { @@ -32,10 +33,10 @@ func DirectConnectConnection(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func directConnectConnectionHandle(ctx context.Context, v types.Connection) Resource { +func directConnectConnectionHandle(ctx context.Context, v types.Connection) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:directconnect:%s:%s:dxcon/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.ConnectionId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.ConnectionId, @@ -45,7 +46,7 @@ func directConnectConnectionHandle(ctx context.Context, v types.Connection) Reso } return resource } -func GetDirectConnectConnection(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDirectConnectConnection(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { connectionId := fields["id"] client := directconnect.NewFromConfig(cfg) out, err := client.DescribeConnections(ctx, &directconnect.DescribeConnectionsInput{ @@ -54,7 +55,7 @@ func GetDirectConnectConnection(ctx context.Context, cfg aws.Config, fields map[ if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Connections { resource := directConnectConnectionHandle(ctx, v) values = append(values, resource) @@ -66,11 +67,11 @@ func getDirectConnectGatewayArn(describeCtx DescribeContext, directConnectGatewa return fmt.Sprintf("arn:%s:directconnect::%s:dx-gateway/%s", describeCtx.Partition, describeCtx.AccountID, directConnectGatewayId) } -func DirectConnectGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DirectConnectGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := directconnect.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { connections, err := client.DescribeDirectConnectGateways(ctx, &directconnect.DescribeDirectConnectGatewaysInput{ MaxResults: aws.Int32(100), @@ -120,7 +121,7 @@ func DirectConnectGateway(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func directConnectGatewayHandle(ctx context.Context, v types.DirectConnectGateway, arnToTagMap map[string][]types.Tag) Resource { +func directConnectGatewayHandle(ctx context.Context, v types.DirectConnectGateway, arnToTagMap map[string][]types.Tag) models.Resource { describeCtx := GetDescribeContext(ctx) arn := getDirectConnectGatewayArn(describeCtx, *v.DirectConnectGatewayId) @@ -129,7 +130,7 @@ func directConnectGatewayHandle(ctx context.Context, v types.DirectConnectGatewa tagsList = []types.Tag{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.DirectConnectGatewayName, @@ -140,7 +141,7 @@ func directConnectGatewayHandle(ctx context.Context, v types.DirectConnectGatewa } return resource } -func GetDirectConnectGateway(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDirectConnectGateway(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) DirectConnectGatewayId := fields["id"] @@ -175,7 +176,7 @@ func GetDirectConnectGateway(ctx context.Context, cfg aws.Config, fields map[str arnToTagMap[*tag.ResourceArn] = tag.Tags } } - var values []Resource + var values []models.Resource for _, v := range out.DirectConnectGateways { resource := directConnectGatewayHandle(ctx, v, arnToTagMap) diff --git a/provider/describer/directoryservice.go b/provider/describer/directoryservice.go index 5d500695..170eae83 100755 --- a/provider/describer/directoryservice.go +++ b/provider/describer/directoryservice.go @@ -6,19 +6,20 @@ import ( "fmt" "github.com/aws/smithy-go" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/directoryservice" "github.com/opengovern/og-describer-aws/provider/model" ) -func DirectoryServiceDirectory(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DirectoryServiceDirectory(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := directoryservice.NewFromConfig(cfg) paginator := directoryservice.NewDescribeDirectoriesPaginator(client, &directoryservice.DescribeDirectoriesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -69,7 +70,7 @@ func DirectoryServiceDirectory(ctx context.Context, cfg aws.Config, stream *Stre } return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.Name, @@ -94,13 +95,13 @@ func DirectoryServiceDirectory(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func DirectoryServiceCertificate(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DirectoryServiceCertificate(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := directoryservice.NewFromConfig(cfg) paginator := directoryservice.NewDescribeDirectoriesPaginator(client, &directoryservice.DescribeDirectoriesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -138,7 +139,7 @@ func DirectoryServiceCertificate(ctx context.Context, cfg aws.Config, stream *St if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *certificate.Certificate.CertificateId, Name: *certificate.Certificate.CommonName, @@ -162,13 +163,13 @@ func DirectoryServiceCertificate(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func DirectoryServiceLogSubscription(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DirectoryServiceLogSubscription(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := directoryservice.NewFromConfig(cfg) paginator := directoryservice.NewDescribeDirectoriesPaginator(client, &directoryservice.DescribeDirectoriesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -193,7 +194,7 @@ func DirectoryServiceLogSubscription(ctx context.Context, cfg aws.Config, stream return nil, err } for _, logSub := range logPage.LogSubscriptions { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *logSub.LogGroupName, Description: model.DirectoryServiceLogSubscriptionDescription{ diff --git a/provider/describer/dlm.go b/provider/describer/dlm.go index 3974d4dd..274ddee3 100755 --- a/provider/describer/dlm.go +++ b/provider/describer/dlm.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/dlm" @@ -9,7 +10,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func DLMLifecyclePolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DLMLifecyclePolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dlm.NewFromConfig(cfg) lifecyclePolicies, err := client.GetLifecyclePolicies(ctx, &dlm.GetLifecyclePoliciesInput{}) @@ -17,11 +18,11 @@ func DLMLifecyclePolicy(ctx context.Context, cfg aws.Config, stream *StreamSende return nil, err } - var values []Resource + var values []models.Resource for _, policySummary := range lifecyclePolicies.Policies { resource, err := dLMLifecyclePolicyHandle(ctx, cfg, policySummary) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -39,7 +40,7 @@ func DLMLifecyclePolicy(ctx context.Context, cfg aws.Config, stream *StreamSende } return values, nil } -func dLMLifecyclePolicyHandle(ctx context.Context, cfg aws.Config, policySummary types.LifecyclePolicySummary) (Resource, error) { +func dLMLifecyclePolicyHandle(ctx context.Context, cfg aws.Config, policySummary types.LifecyclePolicySummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dlm.NewFromConfig(cfg) policy, err := client.GetLifecyclePolicy(ctx, &dlm.GetLifecyclePolicyInput{ @@ -47,12 +48,12 @@ func dLMLifecyclePolicyHandle(ctx context.Context, cfg aws.Config, policySummary }) if err != nil { if isErr(err, "GetLifecyclePolicyNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *policy.Policy.PolicyId, ARN: *policy.Policy.PolicyArn, @@ -62,9 +63,9 @@ func dLMLifecyclePolicyHandle(ctx context.Context, cfg aws.Config, policySummary } return resource, nil } -func GetDLMLifecyclePolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDLMLifecyclePolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { policyId := fields["policyId"] - var values []Resource + var values []models.Resource client := dlm.NewFromConfig(cfg) policies, err := client.GetLifecyclePolicies(ctx, &dlm.GetLifecyclePoliciesInput{ @@ -79,7 +80,7 @@ func GetDLMLifecyclePolicy(ctx context.Context, cfg aws.Config, fields map[strin for _, policySummary := range policies.Policies { resource, err := dLMLifecyclePolicyHandle(ctx, cfg, policySummary) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/dms.go b/provider/describer/dms.go index 1a4add0e..98ed55e0 100755 --- a/provider/describer/dms.go +++ b/provider/describer/dms.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" dms "github.com/aws/aws-sdk-go-v2/service/databasemigrationservice" @@ -9,13 +10,13 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func DMSReplicationInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DMSReplicationInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dms.NewFromConfig(cfg) paginator := dms.NewDescribeReplicationInstancesPaginator(client, &dms.DescribeReplicationInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -27,7 +28,7 @@ func DMSReplicationInstance(ctx context.Context, cfg aws.Config, stream *StreamS if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -44,7 +45,7 @@ func DMSReplicationInstance(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func dMSReplicationInstanceHandle(ctx context.Context, cfg aws.Config, item types.ReplicationInstance) (Resource, error) { +func dMSReplicationInstanceHandle(ctx context.Context, cfg aws.Config, item types.ReplicationInstance) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dms.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &dms.ListTagsForResourceInput{ @@ -52,12 +53,12 @@ func dMSReplicationInstanceHandle(ctx context.Context, cfg aws.Config, item type }) if err != nil { if isErr(err, "ListTagsForResourceNoFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ReplicationInstanceArn, Name: *item.ReplicationInstanceIdentifier, @@ -68,7 +69,7 @@ func dMSReplicationInstanceHandle(ctx context.Context, cfg aws.Config, item type } return resource, nil } -func GetDMSReplicationInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDMSReplicationInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { replicationInstanceArn := fields["arn"] client := dms.NewFromConfig(cfg) @@ -77,7 +78,7 @@ func GetDMSReplicationInstance(ctx context.Context, cfg aws.Config, fields map[s return nil, err } - var values []Resource + var values []models.Resource for _, item := range out.ReplicationInstances { if *item.ReplicationInstanceArn != replicationInstanceArn { @@ -88,7 +89,7 @@ func GetDMSReplicationInstance(ctx context.Context, cfg aws.Config, fields map[s if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -98,13 +99,13 @@ func GetDMSReplicationInstance(ctx context.Context, cfg aws.Config, fields map[s return values, nil } -func DMSEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DMSEndpoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dms.NewFromConfig(cfg) paginator := dms.NewDescribeEndpointsPaginator(client, &dms.DescribeEndpointsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -116,7 +117,7 @@ func DMSEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -134,7 +135,7 @@ func DMSEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func dMSEndpointHandle(ctx context.Context, cfg aws.Config, item types.Endpoint) (Resource, error) { +func dMSEndpointHandle(ctx context.Context, cfg aws.Config, item types.Endpoint) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dms.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &dms.ListTagsForResourceInput{ @@ -142,12 +143,12 @@ func dMSEndpointHandle(ctx context.Context, cfg aws.Config, item types.Endpoint) }) if err != nil { if isErr(err, "ListTagsForResourceNoFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.EndpointArn, Name: *item.EndpointIdentifier, @@ -159,13 +160,13 @@ func dMSEndpointHandle(ctx context.Context, cfg aws.Config, item types.Endpoint) return resource, nil } -func DMSReplicationTask(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DMSReplicationTask(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dms.NewFromConfig(cfg) paginator := dms.NewDescribeReplicationTasksPaginator(client, &dms.DescribeReplicationTasksInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -177,7 +178,7 @@ func DMSReplicationTask(ctx context.Context, cfg aws.Config, stream *StreamSende if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -195,7 +196,7 @@ func DMSReplicationTask(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func dMSReplicationTaskHandle(ctx context.Context, cfg aws.Config, item types.ReplicationTask) (Resource, error) { +func dMSReplicationTaskHandle(ctx context.Context, cfg aws.Config, item types.ReplicationTask) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dms.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &dms.ListTagsForResourceInput{ @@ -203,12 +204,12 @@ func dMSReplicationTaskHandle(ctx context.Context, cfg aws.Config, item types.Re }) if err != nil { if isErr(err, "ListTagsForResourceNoFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ReplicationTaskArn, ID: *item.ReplicationTaskIdentifier, diff --git a/provider/describer/docdb.go b/provider/describer/docdb.go index 135ed82b..cda2a45b 100755 --- a/provider/describer/docdb.go +++ b/provider/describer/docdb.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" types2 "github.com/aws/aws-sdk-go-v2/service/docdb/types" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" @@ -12,11 +13,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func DocDBCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DocDBCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := docdb.NewFromConfig(cfg) paginator := docdb.NewDescribeDBClustersPaginator(client, &docdb.DescribeDBClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -27,7 +28,7 @@ func DocDBCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -44,7 +45,7 @@ func DocDBCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func DocDBClusterHandle(ctx context.Context, cfg aws.Config, cluster types2.DBCluster) (Resource, error) { +func DocDBClusterHandle(ctx context.Context, cfg aws.Config, cluster types2.DBCluster) (models.Resource, error) { client := docdb.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) @@ -53,12 +54,12 @@ func DocDBClusterHandle(ctx context.Context, cfg aws.Config, cluster types2.DBCl }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *cluster.DBClusterIdentifier, ARN: *cluster.DBClusterArn, @@ -69,7 +70,7 @@ func DocDBClusterHandle(ctx context.Context, cfg aws.Config, cluster types2.DBCl } return resource, nil } -func GetDocDBCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDocDBCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := docdb.NewFromConfig(cfg) dbClusterIdentifier := fields["identifier"] @@ -80,14 +81,14 @@ func GetDocDBCluster(ctx context.Context, cfg aws.Config, fields map[string]stri return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range out.DBClusters { resource, err := DocDBClusterHandle(ctx, cfg, cluster) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -97,11 +98,11 @@ func GetDocDBCluster(ctx context.Context, cfg aws.Config, fields map[string]stri return values, nil } -func DocDBClusterInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DocDBClusterInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := docdb.NewFromConfig(cfg) paginator := docdb.NewDescribeDBInstancesPaginator(client, &docdb.DescribeDBInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -112,7 +113,7 @@ func DocDBClusterInstance(ctx context.Context, cfg aws.Config, stream *StreamSen if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -130,7 +131,7 @@ func DocDBClusterInstance(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func DocDBClusterInstanceHandle(ctx context.Context, cfg aws.Config, instance types2.DBInstance) (Resource, error) { +func DocDBClusterInstanceHandle(ctx context.Context, cfg aws.Config, instance types2.DBInstance) (models.Resource, error) { client := docdb.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) @@ -139,12 +140,12 @@ func DocDBClusterInstanceHandle(ctx context.Context, cfg aws.Config, instance ty }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *instance.DBInstanceIdentifier, ARN: *instance.DBInstanceArn, @@ -156,7 +157,7 @@ func DocDBClusterInstanceHandle(ctx context.Context, cfg aws.Config, instance ty return resource, nil } -func GetDocDBClusterInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDocDBClusterInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := docdb.NewFromConfig(cfg) identifier := fields["identifier"] @@ -167,14 +168,14 @@ func GetDocDBClusterInstance(ctx context.Context, cfg aws.Config, fields map[str return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range out.DBInstances { resource, err := DocDBClusterInstanceHandle(ctx, cfg, cluster) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -184,12 +185,12 @@ func GetDocDBClusterInstance(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func DocDBClusterSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DocDBClusterSnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := docdb.NewFromConfig(cfg) paginator := docdb.NewDescribeDBClustersPaginator(client, &docdb.DescribeDBClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -227,7 +228,7 @@ func DocDBClusterSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func DocDBClusterSnapshotHandle(ctx context.Context, docdbClient *docdb.Client, cfg aws.Config, snapshot types2.DBClusterSnapshot) (Resource, error) { +func DocDBClusterSnapshotHandle(ctx context.Context, docdbClient *docdb.Client, cfg aws.Config, snapshot types2.DBClusterSnapshot) (models.Resource, error) { client := docdb.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) @@ -236,9 +237,9 @@ func DocDBClusterSnapshotHandle(ctx context.Context, docdbClient *docdb.Client, }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } params := &docdb.DescribeDBClusterSnapshotAttributesInput{ @@ -248,10 +249,10 @@ func DocDBClusterSnapshotHandle(ctx context.Context, docdbClient *docdb.Client, dbClusterSnapshotData, err := docdbClient.DescribeDBClusterSnapshotAttributes(ctx, params) if err != nil { plugin.Logger(ctx).Error("aws_docdb_cluster_snapshot.getAwsDocDBClusterSnapshotAttributes", "api_error", err) - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *snapshot.DBClusterSnapshotIdentifier, ARN: *snapshot.DBClusterSnapshotArn, diff --git a/provider/describer/drs.go b/provider/describer/drs.go index 6918fb29..afcb2454 100755 --- a/provider/describer/drs.go +++ b/provider/describer/drs.go @@ -2,20 +2,21 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/drs" "github.com/opengovern/og-describer-aws/provider/model" ) -func DRSSourceServer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DRSSourceServer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := drs.NewFromConfig(cfg) paginator := drs.NewDescribeSourceServersPaginator(client, &drs.DescribeSourceServersInput{ MaxResults: aws.Int32(100), }) - var values []Resource + var values []models.Resource pageNo := 0 for paginator.HasMorePages() && pageNo < 5 { pageNo++ @@ -35,7 +36,7 @@ func DRSSourceServer(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.SourceServerID, @@ -57,14 +58,14 @@ func DRSSourceServer(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func DRSRecoveryInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DRSRecoveryInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := drs.NewFromConfig(cfg) paginator := drs.NewDescribeRecoveryInstancesPaginator(client, &drs.DescribeRecoveryInstancesInput{ MaxResults: aws.Int32(100), }) - var values []Resource + var values []models.Resource pageNo := 0 for paginator.HasMorePages() && pageNo < 5 { pageNo++ @@ -77,7 +78,7 @@ func DRSRecoveryInstance(ctx context.Context, cfg aws.Config, stream *StreamSend } for _, v := range page.Items { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.RecoveryInstanceID, @@ -98,14 +99,14 @@ func DRSRecoveryInstance(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func DRSJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DRSJob(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := drs.NewFromConfig(cfg) paginator := drs.NewDescribeJobsPaginator(client, &drs.DescribeJobsInput{ MaxResults: aws.Int32(100), }) - var values []Resource + var values []models.Resource pageNo := 0 for paginator.HasMorePages() && pageNo < 5 { pageNo++ @@ -118,7 +119,7 @@ func DRSJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour } for _, v := range page.Items { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, ID: *v.JobID, @@ -139,14 +140,14 @@ func DRSJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour return values, nil } -func DRSRecoverySnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DRSRecoverySnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := drs.NewFromConfig(cfg) paginator := drs.NewDescribeSourceServersPaginator(client, &drs.DescribeSourceServersInput{ MaxResults: aws.Int32(100), }) - var values []Resource + var values []models.Resource sourceServerPageNo := 0 for paginator.HasMorePages() && sourceServerPageNo < 5 { sourceServerPageNo++ @@ -173,7 +174,7 @@ func DRSRecoverySnapshot(ctx context.Context, cfg aws.Config, stream *StreamSend } for _, recoverySnapshot := range recoverySnapshotPage.Items { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *recoverySnapshot.SnapshotID, Description: model.DRSRecoverySnapshotDescription{ diff --git a/provider/describer/dynamodb.go b/provider/describer/dynamodb.go index a5511810..8ca63781 100755 --- a/provider/describer/dynamodb.go +++ b/provider/describer/dynamodb.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "time" _ "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" @@ -13,11 +14,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func DynamoDbTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDbTable(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dynamodb.NewFromConfig(cfg) paginator := dynamodb.NewListTablesPaginator(client, &dynamodb.ListTablesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -31,7 +32,7 @@ func DynamoDbTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -48,7 +49,7 @@ func DynamoDbTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func DynamoDbTableHandle(ctx context.Context, cfg aws.Config, tableName string) (Resource, error) { +func DynamoDbTableHandle(ctx context.Context, cfg aws.Config, tableName string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dynamodb.NewFromConfig(cfg) v, err := client.DescribeTable(ctx, &dynamodb.DescribeTableInput{ @@ -56,9 +57,9 @@ func DynamoDbTableHandle(ctx context.Context, cfg aws.Config, tableName string) }) if err != nil { if isErr(err, "ListTagsOfResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } continuousBackup, err := client.DescribeContinuousBackups(ctx, &dynamodb.DescribeContinuousBackupsInput{ @@ -66,9 +67,9 @@ func DynamoDbTableHandle(ctx context.Context, cfg aws.Config, tableName string) }) if err != nil { if isErr(err, "ListTagsOfResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } streamingDestination, err := client.DescribeKinesisStreamingDestination(ctx, &dynamodb.DescribeKinesisStreamingDestinationInput{ @@ -76,9 +77,9 @@ func DynamoDbTableHandle(ctx context.Context, cfg aws.Config, tableName string) }) if err != nil { if isErr(err, "ListTagsOfResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } tags, err := client.ListTagsOfResource(ctx, &dynamodb.ListTagsOfResourceInput{ @@ -86,12 +87,12 @@ func DynamoDbTableHandle(ctx context.Context, cfg aws.Config, tableName string) }) if err != nil { if isErr(err, "ListTagsOfResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Table.TableArn, Name: *v.Table.TableName, @@ -105,14 +106,14 @@ func DynamoDbTableHandle(ctx context.Context, cfg aws.Config, tableName string) return resource, nil } -func GetDynamoDbTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDynamoDbTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { tableName := fields["tableName"] - var values []Resource + var values []models.Resource resource, err := DynamoDbTableHandle(ctx, cfg, tableName) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -120,12 +121,12 @@ func GetDynamoDbTable(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func DynamoDbGlobalSecondaryIndex(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDbGlobalSecondaryIndex(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dynamodb.NewFromConfig(cfg) paginator := dynamodb.NewListTablesPaginator(client, &dynamodb.ListTablesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -143,7 +144,7 @@ func DynamoDbGlobalSecondaryIndex(ctx context.Context, cfg aws.Config, stream *S } for _, v := range tableOutput.Table.GlobalSecondaryIndexes { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.IndexArn, Name: *v.IndexName, @@ -164,13 +165,13 @@ func DynamoDbGlobalSecondaryIndex(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func GetDynamoDbGlobalSecondaryIndex(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetDynamoDbGlobalSecondaryIndex(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) tableName := fields["name"] client := dynamodb.NewFromConfig(cfg) - var values []Resource + var values []models.Resource tableOutput, err := client.DescribeTable(ctx, &dynamodb.DescribeTableInput{ TableName: &tableName, }) @@ -179,7 +180,7 @@ func GetDynamoDbGlobalSecondaryIndex(ctx context.Context, cfg aws.Config, fields } for _, v := range tableOutput.Table.GlobalSecondaryIndexes { - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *v.IndexArn, Name: *v.IndexName, @@ -192,12 +193,12 @@ func GetDynamoDbGlobalSecondaryIndex(ctx context.Context, cfg aws.Config, fields return values, nil } -func DynamoDbLocalSecondaryIndex(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDbLocalSecondaryIndex(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dynamodb.NewFromConfig(cfg) paginator := dynamodb.NewListTablesPaginator(client, &dynamodb.ListTablesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -215,7 +216,7 @@ func DynamoDbLocalSecondaryIndex(ctx context.Context, cfg aws.Config, stream *St } for _, v := range tableOutput.Table.LocalSecondaryIndexes { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.IndexArn, Name: *v.IndexName, @@ -237,10 +238,10 @@ func DynamoDbLocalSecondaryIndex(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func DynamoDbStream(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDbStream(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dynamodbstreams.NewFromConfig(cfg) - var values []Resource + var values []models.Resource var lastArn *string = nil for { streams, err := client.ListStreams(ctx, &dynamodbstreams.ListStreamsInput{ @@ -256,7 +257,7 @@ func DynamoDbStream(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } for _, v := range streams.Streams { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.StreamArn, Name: *v.StreamLabel, @@ -281,10 +282,10 @@ func DynamoDbStream(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func DynamoDbBackUp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDbBackUp(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dynamodb.NewFromConfig(cfg) - var values []Resource + var values []models.Resource var lastArn *string = nil for { backups, err := client.ListBackups(ctx, &dynamodb.ListBackupsInput{ @@ -302,7 +303,7 @@ func DynamoDbBackUp(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } for _, v := range backups.BackupSummaries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.BackupArn, Name: *v.BackupName, @@ -328,10 +329,10 @@ func DynamoDbBackUp(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func DynamoDbGlobalTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDbGlobalTable(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := dynamodb.NewFromConfig(cfg) - var values []Resource + var values []models.Resource var last *string = nil for { globalTables, err := client.ListGlobalTables(ctx, &dynamodb.ListGlobalTablesInput{ @@ -353,7 +354,7 @@ func DynamoDbGlobalTable(ctx context.Context, cfg aws.Config, stream *StreamSend if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -375,7 +376,7 @@ func DynamoDbGlobalTable(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func DynamoDbGlobalTableHandle(ctx context.Context, cfg aws.Config, tableName string) (Resource, error) { +func DynamoDbGlobalTableHandle(ctx context.Context, cfg aws.Config, tableName string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dynamodb.NewFromConfig(cfg) @@ -384,12 +385,12 @@ func DynamoDbGlobalTableHandle(ctx context.Context, cfg aws.Config, tableName st }) if err != nil { if isErr(err, "ResourceNotFoundException") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *globalTable.GlobalTableDescription.GlobalTableArn, Name: *globalTable.GlobalTableDescription.GlobalTableName, @@ -399,15 +400,15 @@ func DynamoDbGlobalTableHandle(ctx context.Context, cfg aws.Config, tableName st } return resource, nil } -func GetDynamoDbGlobalTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetDynamoDbGlobalTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource globalTableName := fields["globalTableName"] resource, err := DynamoDbGlobalTableHandle(ctx, cfg, globalTableName) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -416,12 +417,12 @@ func GetDynamoDbGlobalTable(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func DynamoDbTableExport(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDbTableExport(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := dynamodb.NewFromConfig(cfg) paginator := dynamodb.NewListExportsPaginator(client, &dynamodb.ListExportsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -436,7 +437,7 @@ func DynamoDbTableExport(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *export.ExportDescription.ExportArn, Description: model.DynamoDbTableExportDescription{ @@ -456,16 +457,16 @@ func DynamoDbTableExport(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func DynamoDBMetricAccountProvisionedReadCapacityUtilization(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDBMetricAccountProvisionedReadCapacityUtilization(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) metrics, err := listCloudWatchMetricStatistics(ctx, cfg, "5_MIN", "AWS/DynamoDB", "AccountProvisionedWriteCapacityUtilization", "", "") if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("dynamodb-metric-account-provisioned-read-capacity-utilization-%s-%s-%s", *metric.DimensionName, *metric.DimensionValue, metric.Timestamp.Format(time.RFC3339)), Description: model.DynamoDBMetricAccountProvisionedReadCapacityUtilizationDescription{ @@ -485,16 +486,16 @@ func DynamoDBMetricAccountProvisionedReadCapacityUtilization(ctx context.Context return values, nil } -func DynamoDBMetricAccountProvisionedWriteCapacityUtilization(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func DynamoDBMetricAccountProvisionedWriteCapacityUtilization(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) metrics, err := listCloudWatchMetricStatistics(ctx, cfg, "5_MIN", "AWS/DynamoDB", "AccountProvisionedWriteCapacityUtilization", "", "") if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("dynamodb-metric-account-provisioned-write-capacity-utilization-%s-%s-%s", *metric.DimensionName, *metric.DimensionValue, metric.Timestamp.Format(time.RFC3339)), Description: model.DynamoDBMetricAccountProvisionedWriteCapacityUtilizationDescription{ diff --git a/provider/describer/ec2.go b/provider/describer/ec2.go index 822bf737..789beb9f 100755 --- a/provider/describer/ec2.go +++ b/provider/describer/ec2.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "time" @@ -16,8 +17,8 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func EC2ElasticIP(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { - var values []Resource +func EC2ElasticIP(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { + var values []models.Resource describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) @@ -27,7 +28,7 @@ func EC2ElasticIP(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] } for _, addr := range addrs.Addresses { - resource := Resource{ + resource := models.Resource{ ID: *addr.AllocationId, Region: describeCtx.OGRegion, Description: model.EC2ElasticIPDescription{ @@ -47,11 +48,11 @@ func EC2ElasticIP(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func EC2LocalGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2LocalGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeLocalGatewaysPaginator(client, &ec2.DescribeLocalGatewaysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -71,10 +72,10 @@ func EC2LocalGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func eC2LocalGatewayHandle(ctx context.Context, v types.LocalGateway) Resource { +func eC2LocalGatewayHandle(ctx context.Context, v types.LocalGateway) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":local-gateway/" + *v.LocalGatewayId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.LocalGatewayId, @@ -85,8 +86,8 @@ func eC2LocalGatewayHandle(ctx context.Context, v types.LocalGateway) Resource { return resource } -func EC2VolumeSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { - var values []Resource +func EC2VolumeSnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { + var values []models.Resource client := ec2.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) @@ -129,11 +130,11 @@ func EC2VolumeSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func eC2VolumeSnapshotHandle(ctx context.Context, v types.Snapshot, attrs *ec2.DescribeSnapshotAttributeOutput) Resource { +func eC2VolumeSnapshotHandle(ctx context.Context, v types.Snapshot, attrs *ec2.DescribeSnapshotAttributeOutput) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":snapshot/" + *v.SnapshotId fmt.Println("=======", arn) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.SnapshotId, @@ -144,7 +145,7 @@ func eC2VolumeSnapshotHandle(ctx context.Context, v types.Snapshot, attrs *ec2.D } return resource } -func GetEC2VolumeSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2VolumeSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { VolumeSnapshotId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -155,7 +156,7 @@ func GetEC2VolumeSnapshot(ctx context.Context, cfg aws.Config, fields map[string return nil, err } - var values []Resource + var values []models.Resource for _, snapshot := range out.Snapshots { attrs, err := client.DescribeSnapshotAttribute(ctx, &ec2.DescribeSnapshotAttributeInput{ Attribute: types.SnapshotAttributeNameCreateVolumePermission, @@ -174,8 +175,8 @@ func GetEC2VolumeSnapshot(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func EC2Volume(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { - var values []Resource +func EC2Volume(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { + var values []models.Resource client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVolumesPaginator(client, &ec2.DescribeVolumesInput{}) @@ -186,7 +187,7 @@ func EC2Volume(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res } for _, volume := range page.Volumes { - var resource Resource + var resource models.Resource resource, err = eC2VolumeHandle(ctx, volume, client) if err != nil { return nil, err @@ -203,7 +204,7 @@ func EC2Volume(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return values, nil } -func eC2VolumeHandle(ctx context.Context, v types.Volume, client *ec2.Client) (Resource, error) { +func eC2VolumeHandle(ctx context.Context, v types.Volume, client *ec2.Client) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) volume := v var description model.EC2VolumeDescription @@ -220,7 +221,7 @@ func eC2VolumeHandle(ctx context.Context, v types.Volume, client *ec2.Client) (R VolumeId: volume.VolumeId, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } switch attr { @@ -232,7 +233,7 @@ func eC2VolumeHandle(ctx context.Context, v types.Volume, client *ec2.Client) (R } arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":volume/" + *volume.VolumeId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *volume.VolumeId, @@ -240,7 +241,7 @@ func eC2VolumeHandle(ctx context.Context, v types.Volume, client *ec2.Client) (R } return resource, nil } -func GetEC2Volume(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2Volume(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { volumeId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -251,9 +252,9 @@ func GetEC2Volume(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, err } - var values []Resource + var values []models.Resource for _, volume := range out.Volumes { - var resource Resource + var resource models.Resource resource, err = eC2VolumeHandle(ctx, volume, client) if err != nil { return nil, err @@ -263,11 +264,11 @@ func GetEC2Volume(ctx context.Context, cfg aws.Config, fields map[string]string) return values, nil } -func EC2CapacityReservation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2CapacityReservation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeCapacityReservationsPaginator(client, &ec2.DescribeCapacityReservationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -291,9 +292,9 @@ func EC2CapacityReservation(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func eC2CapacityReservationHandle(ctx context.Context, v types.CapacityReservation) Resource { +func eC2CapacityReservationHandle(ctx context.Context, v types.CapacityReservation) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.CapacityReservationArn, Name: *v.CapacityReservationId, @@ -303,7 +304,7 @@ func eC2CapacityReservationHandle(ctx context.Context, v types.CapacityReservati } return resource } -func GetEC2CapacityReservation(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2CapacityReservation(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { ReservationId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -314,7 +315,7 @@ func GetEC2CapacityReservation(ctx context.Context, cfg aws.Config, fields map[s return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.CapacityReservations { resource := eC2CapacityReservationHandle(ctx, v) values = append(values, resource) @@ -322,11 +323,11 @@ func GetEC2CapacityReservation(ctx context.Context, cfg aws.Config, fields map[s return values, nil } -func EC2CapacityReservationFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2CapacityReservationFleet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeCapacityReservationFleetsPaginator(client, &ec2.DescribeCapacityReservationFleetsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -347,9 +348,9 @@ func EC2CapacityReservationFleet(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func eC2CapacityReservationFleetHandle(ctx context.Context, v types.CapacityReservationFleet) Resource { +func eC2CapacityReservationFleetHandle(ctx context.Context, v types.CapacityReservationFleet) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.CapacityReservationFleetArn, Name: *v.CapacityReservationFleetId, @@ -359,7 +360,7 @@ func eC2CapacityReservationFleetHandle(ctx context.Context, v types.CapacityRese } return resource } -func GetEC2CapacityReservationFleet(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2CapacityReservationFleet(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { CapacityReservationFleetId := field["id"] client := ec2.NewFromConfig(cfg) @@ -370,7 +371,7 @@ func GetEC2CapacityReservationFleet(ctx context.Context, cfg aws.Config, field m return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.CapacityReservationFleets { resource := eC2CapacityReservationFleetHandle(ctx, v) values = append(values, resource) @@ -378,12 +379,12 @@ func GetEC2CapacityReservationFleet(ctx context.Context, cfg aws.Config, field m return values, nil } -func EC2CarrierGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2CarrierGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeCarrierGatewaysPaginator(client, &ec2.DescribeCarrierGatewaysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -391,7 +392,7 @@ func EC2CarrierGateway(ctx context.Context, cfg aws.Config, stream *StreamSender } for _, v := range page.CarrierGateways { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.CarrierGatewayId, Name: *v.CarrierGatewayId, @@ -410,7 +411,7 @@ func EC2CarrierGateway(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func EC2ClientVpnAuthorizationRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2ClientVpnAuthorizationRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) endpoints, err := EC2ClientVpnEndpoint(ctx, cfg, nil) if err != nil { @@ -419,7 +420,7 @@ func EC2ClientVpnAuthorizationRule(ctx context.Context, cfg aws.Config, stream * client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, e := range endpoints { endpoint := e.Description.(types.ClientVpnEndpoint) paginator := ec2.NewDescribeClientVpnAuthorizationRulesPaginator(client, &ec2.DescribeClientVpnAuthorizationRulesInput{ @@ -433,7 +434,7 @@ func EC2ClientVpnAuthorizationRule(ctx context.Context, cfg aws.Config, stream * } for _, v := range page.AuthorizationRules { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*v.ClientVpnEndpointId, *v.DestinationCidr, *v.GroupId), Name: *v.ClientVpnEndpointId, @@ -453,12 +454,12 @@ func EC2ClientVpnAuthorizationRule(ctx context.Context, cfg aws.Config, stream * return values, nil } -func EC2ClientVpnEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2ClientVpnEndpoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeClientVpnEndpointsPaginator(client, &ec2.DescribeClientVpnEndpointsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -470,7 +471,7 @@ func EC2ClientVpnEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSen } for _, v := range page.ClientVpnEndpoints { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ClientVpnEndpointId, Name: *v.ClientVpnEndpointId, @@ -491,7 +492,7 @@ func EC2ClientVpnEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func EC2ClientVpnRoute(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2ClientVpnRoute(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) endpoints, err := EC2ClientVpnEndpoint(ctx, cfg, nil) if err != nil { @@ -500,7 +501,7 @@ func EC2ClientVpnRoute(ctx context.Context, cfg aws.Config, stream *StreamSender client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, e := range endpoints { endpoint := e.Description.(types.ClientVpnEndpoint) paginator := ec2.NewDescribeClientVpnRoutesPaginator(client, &ec2.DescribeClientVpnRoutesInput{ @@ -514,7 +515,7 @@ func EC2ClientVpnRoute(ctx context.Context, cfg aws.Config, stream *StreamSender } for _, v := range page.Routes { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*v.ClientVpnEndpointId, *v.DestinationCidr, *v.TargetSubnet), Name: *v.ClientVpnEndpointId, @@ -534,7 +535,7 @@ func EC2ClientVpnRoute(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func EC2ClientVpnTargetNetworkAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2ClientVpnTargetNetworkAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) endpoints, err := EC2ClientVpnEndpoint(ctx, cfg, nil) if err != nil { @@ -543,7 +544,7 @@ func EC2ClientVpnTargetNetworkAssociation(ctx context.Context, cfg aws.Config, s client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, e := range endpoints { endpoint := e.Description.(types.ClientVpnEndpoint) paginator := ec2.NewDescribeClientVpnTargetNetworksPaginator(client, &ec2.DescribeClientVpnTargetNetworksInput{ @@ -557,7 +558,7 @@ func EC2ClientVpnTargetNetworkAssociation(ctx context.Context, cfg aws.Config, s } for _, v := range page.ClientVpnTargetNetworks { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.AssociationId, Name: *v.AssociationId, @@ -577,14 +578,14 @@ func EC2ClientVpnTargetNetworkAssociation(ctx context.Context, cfg aws.Config, s return values, nil } -func EC2CustomerGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2CustomerGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) output, err := client.DescribeCustomerGateways(ctx, &ec2.DescribeCustomerGatewaysInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.CustomerGateways { resource := eC2CustomerGatewayHandle(ctx, v) if stream != nil { @@ -598,9 +599,9 @@ func EC2CustomerGateway(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func eC2CustomerGatewayHandle(ctx context.Context, v types.CustomerGateway) Resource { +func eC2CustomerGatewayHandle(ctx context.Context, v types.CustomerGateway) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.CustomerGatewayId, Description: model.EC2CustomerGatewayDescription{ @@ -609,7 +610,7 @@ func eC2CustomerGatewayHandle(ctx context.Context, v types.CustomerGateway) Reso } return resource } -func GetEC2CustomerGateway(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2CustomerGateway(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2CustomerGatewayId := field["id"] client := ec2.NewFromConfig(cfg) @@ -620,7 +621,7 @@ func GetEC2CustomerGateway(ctx context.Context, cfg aws.Config, field map[string return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.CustomerGateways { resource := eC2CustomerGatewayHandle(ctx, v) values = append(values, resource) @@ -628,12 +629,12 @@ func GetEC2CustomerGateway(ctx context.Context, cfg aws.Config, field map[string return values, nil } -func EC2VerifiedAccessInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VerifiedAccessInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) input := &ec2.DescribeVerifiedAccessInstancesInput{} - var values []Resource + var values []models.Resource for { resp, err := client.DescribeVerifiedAccessInstances(ctx, input) if err != nil { @@ -659,9 +660,9 @@ func EC2VerifiedAccessInstance(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func eC2VerifiedAccessInstanceHandle(ctx context.Context, v types.VerifiedAccessInstance) Resource { +func eC2VerifiedAccessInstanceHandle(ctx context.Context, v types.VerifiedAccessInstance) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.VerifiedAccessInstanceId, Name: *v.VerifiedAccessInstanceId, @@ -671,7 +672,7 @@ func eC2VerifiedAccessInstanceHandle(ctx context.Context, v types.VerifiedAccess } return resource } -func GetEC2VerifiedAccessInstance(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2VerifiedAccessInstance(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2VerifiedAccessInstanceId := field["id"] client := ec2.NewFromConfig(cfg) @@ -682,7 +683,7 @@ func GetEC2VerifiedAccessInstance(ctx context.Context, cfg aws.Config, field map return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.VerifiedAccessInstances { resource := eC2VerifiedAccessInstanceHandle(ctx, v) values = append(values, resource) @@ -691,12 +692,12 @@ func GetEC2VerifiedAccessInstance(ctx context.Context, cfg aws.Config, field map return values, nil } -func EC2VerifiedAccessEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VerifiedAccessEndpoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) input := &ec2.DescribeVerifiedAccessEndpointsInput{} - var values []Resource + var values []models.Resource for { resp, err := client.DescribeVerifiedAccessEndpoints(ctx, input) if err != nil { @@ -722,9 +723,9 @@ func EC2VerifiedAccessEndpoint(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func eC2VerifiedAccessEndpointHandle(ctx context.Context, v types.VerifiedAccessEndpoint) Resource { +func eC2VerifiedAccessEndpointHandle(ctx context.Context, v types.VerifiedAccessEndpoint) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.VerifiedAccessEndpointId, Name: *v.VerifiedAccessEndpointId, @@ -734,7 +735,7 @@ func eC2VerifiedAccessEndpointHandle(ctx context.Context, v types.VerifiedAccess } return resource } -func GetEC2VerifiedAccessEndpoint(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2VerifiedAccessEndpoint(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2VerifiedAccessEndpointId := field["id"] client := ec2.NewFromConfig(cfg) @@ -746,7 +747,7 @@ func GetEC2VerifiedAccessEndpoint(ctx context.Context, cfg aws.Config, field map return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.VerifiedAccessEndpoints { resource := eC2VerifiedAccessEndpointHandle(ctx, v) values = append(values, resource) @@ -755,12 +756,12 @@ func GetEC2VerifiedAccessEndpoint(ctx context.Context, cfg aws.Config, field map return values, nil } -func EC2VerifiedAccessGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VerifiedAccessGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) input := &ec2.DescribeVerifiedAccessGroupsInput{} - var values []Resource + var values []models.Resource for { resp, err := client.DescribeVerifiedAccessGroups(ctx, input) if err != nil { @@ -786,9 +787,9 @@ func EC2VerifiedAccessGroup(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func eC2VerifiedAccessGroupHandle(ctx context.Context, v types.VerifiedAccessGroup) Resource { +func eC2VerifiedAccessGroupHandle(ctx context.Context, v types.VerifiedAccessGroup) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.VerifiedAccessGroupId, Name: *v.VerifiedAccessGroupId, @@ -798,7 +799,7 @@ func eC2VerifiedAccessGroupHandle(ctx context.Context, v types.VerifiedAccessGro } return resource } -func GetEC2VerifiedAccessGroup(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2VerifiedAccessGroup(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2VerifiedAccessGroupId := field["group_id"] client := ec2.NewFromConfig(cfg) @@ -809,7 +810,7 @@ func GetEC2VerifiedAccessGroup(ctx context.Context, cfg aws.Config, field map[st return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.VerifiedAccessGroups { resource := eC2VerifiedAccessGroupHandle(ctx, v) values = append(values, resource) @@ -818,12 +819,12 @@ func GetEC2VerifiedAccessGroup(ctx context.Context, cfg aws.Config, field map[st return values, nil } -func EC2VerifiedAccessTrustProvider(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VerifiedAccessTrustProvider(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) input := &ec2.DescribeVerifiedAccessTrustProvidersInput{} - var values []Resource + var values []models.Resource for { resp, err := client.DescribeVerifiedAccessTrustProviders(ctx, input) if err != nil { @@ -849,9 +850,9 @@ func EC2VerifiedAccessTrustProvider(ctx context.Context, cfg aws.Config, stream return values, nil } -func eC2VerifiedAccessTrustProviderHandle(ctx context.Context, v types.VerifiedAccessTrustProvider) Resource { +func eC2VerifiedAccessTrustProviderHandle(ctx context.Context, v types.VerifiedAccessTrustProvider) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.VerifiedAccessTrustProviderId, Name: *v.VerifiedAccessTrustProviderId, @@ -861,7 +862,7 @@ func eC2VerifiedAccessTrustProviderHandle(ctx context.Context, v types.VerifiedA } return resource } -func GetEC2VerifiedAccessTrustProvider(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2VerifiedAccessTrustProvider(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2VerifiedAccessTrustProviderId := field["id"] client := ec2.NewFromConfig(cfg) @@ -872,7 +873,7 @@ func GetEC2VerifiedAccessTrustProvider(ctx context.Context, cfg aws.Config, fiel return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.VerifiedAccessTrustProviders { resource := eC2VerifiedAccessTrustProviderHandle(ctx, v) values = append(values, resource) @@ -881,11 +882,11 @@ func GetEC2VerifiedAccessTrustProvider(ctx context.Context, cfg aws.Config, fiel return values, nil } -func EC2DHCPOptions(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2DHCPOptions(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeDhcpOptionsPaginator(client, &ec2.DescribeDhcpOptionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -909,11 +910,11 @@ func EC2DHCPOptions(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func eC2DHCPOptionsHandle(ctx context.Context, v types.DhcpOptions) Resource { +func eC2DHCPOptionsHandle(ctx context.Context, v types.DhcpOptions) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:dhcp-options/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.DhcpOptionsId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.DhcpOptionsId, @@ -923,7 +924,7 @@ func eC2DHCPOptionsHandle(ctx context.Context, v types.DhcpOptions) Resource { } return resource } -func GetEC2DHCPOptions(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2DHCPOptions(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2DHCPOptionsId := field["id"] client := ec2.NewFromConfig(cfg) @@ -934,7 +935,7 @@ func GetEC2DHCPOptions(ctx context.Context, cfg aws.Config, field map[string]str return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.DhcpOptions { resource := eC2DHCPOptionsHandle(ctx, v) values = append(values, resource) @@ -943,11 +944,11 @@ func GetEC2DHCPOptions(ctx context.Context, cfg aws.Config, field map[string]str return values, nil } -func EC2Fleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2Fleet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeFleetsPaginator(client, &ec2.DescribeFleetsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -968,10 +969,10 @@ func EC2Fleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func eC2FleetHandle(ctx context.Context, v types.FleetData) Resource { +func eC2FleetHandle(ctx context.Context, v types.FleetData) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:fleet/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.FleetId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: arn, Name: *v.FleetId, @@ -981,7 +982,7 @@ func eC2FleetHandle(ctx context.Context, v types.FleetData) Resource { } return resource } -func GetEC2Fleet(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2Fleet(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2FleetId := field["id"] client := ec2.NewFromConfig(cfg) @@ -992,7 +993,7 @@ func GetEC2Fleet(ctx context.Context, cfg aws.Config, field map[string]string) ( return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Fleets { resource := eC2FleetHandle(ctx, v) values = append(values, resource) @@ -1000,11 +1001,11 @@ func GetEC2Fleet(ctx context.Context, cfg aws.Config, field map[string]string) ( return values, nil } -func EC2EgressOnlyInternetGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2EgressOnlyInternetGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeEgressOnlyInternetGatewaysPaginator(client, &ec2.DescribeEgressOnlyInternetGatewaysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1028,10 +1029,10 @@ func EC2EgressOnlyInternetGateway(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func eC2EgressOnlyInternetGatewayHandle(ctx context.Context, v types.EgressOnlyInternetGateway) Resource { +func eC2EgressOnlyInternetGatewayHandle(ctx context.Context, v types.EgressOnlyInternetGateway) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:egress-only-internet-gateway/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.EgressOnlyInternetGatewayId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: arn, Name: *v.EgressOnlyInternetGatewayId, @@ -1041,7 +1042,7 @@ func eC2EgressOnlyInternetGatewayHandle(ctx context.Context, v types.EgressOnlyI } return resource } -func GetEC2EgressOnlyInternetGateway(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2EgressOnlyInternetGateway(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2EgressOnlyInternetGatewayId := field["id"] client := ec2.NewFromConfig(cfg) @@ -1052,7 +1053,7 @@ func GetEC2EgressOnlyInternetGateway(ctx context.Context, cfg aws.Config, field return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.EgressOnlyInternetGateways { resource := eC2EgressOnlyInternetGatewayHandle(ctx, v) values = append(values, resource) @@ -1060,7 +1061,7 @@ func GetEC2EgressOnlyInternetGateway(ctx context.Context, cfg aws.Config, field return values, nil } -func EC2EIP(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2EIP(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) output, err := client.DescribeAddresses(ctx, &ec2.DescribeAddressesInput{}) if err != nil { @@ -1070,7 +1071,7 @@ func EC2EIP(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour return nil, nil } - var values []Resource + var values []models.Resource for _, v := range output.Addresses { resource := eC2EIPHandle(ctx, v) if stream != nil { @@ -1083,10 +1084,10 @@ func EC2EIP(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour } return values, nil } -func eC2EIPHandle(ctx context.Context, v types.Address) Resource { +func eC2EIPHandle(ctx context.Context, v types.Address) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":eip/" + *v.AllocationId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.AllocationId, @@ -1096,7 +1097,7 @@ func eC2EIPHandle(ctx context.Context, v types.Address) Resource { } return resource } -func GetEC2EIP(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2EIP(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { allocationId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -1109,7 +1110,7 @@ func GetEC2EIP(ctx context.Context, cfg aws.Config, fields map[string]string) ([ } return nil, nil } - var values []Resource + var values []models.Resource for _, v := range output.Addresses { resource := eC2EIPHandle(ctx, v) values = append(values, resource) @@ -1117,19 +1118,19 @@ func GetEC2EIP(ctx context.Context, cfg aws.Config, fields map[string]string) ([ return values, nil } -func EC2EIPAddressTransfer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2EIPAddressTransfer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) paginator := ec2.NewDescribeAddressTransfersPaginator(client, &ec2.DescribeAddressTransfersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } for _, item := range page.AddressTransfers { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *item.TransferAccountId, Name: *item.TransferAccountId, @@ -1149,7 +1150,7 @@ func EC2EIPAddressTransfer(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func EC2EnclaveCertificateIamRoleAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2EnclaveCertificateIamRoleAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) certs, err := CertificateManagerCertificate(ctx, cfg, nil) if err != nil { @@ -1158,7 +1159,7 @@ func EC2EnclaveCertificateIamRoleAssociation(ctx context.Context, cfg aws.Config client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, c := range certs { cert := c.Description.(model.CertificateManagerCertificateDescription) @@ -1170,7 +1171,7 @@ func EC2EnclaveCertificateIamRoleAssociation(ctx context.Context, cfg aws.Config } for _, v := range output.AssociatedRoles { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.AssociatedRoleArn, // Don't set to ARN since that will be the same for the role itself and this association Name: *v.AssociatedRoleArn, @@ -1190,11 +1191,11 @@ func EC2EnclaveCertificateIamRoleAssociation(ctx context.Context, cfg aws.Config return values, nil } -func EC2FlowLog(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2FlowLog(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeFlowLogsPaginator(client, &ec2.DescribeFlowLogsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1214,10 +1215,10 @@ func EC2FlowLog(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re } return values, nil } -func eC2FlowLogHandle(ctx context.Context, v types.FlowLog) Resource { +func eC2FlowLogHandle(ctx context.Context, v types.FlowLog) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":vpc-flow-log/" + *v.FlowLogId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.FlowLogId, @@ -1227,7 +1228,7 @@ func eC2FlowLogHandle(ctx context.Context, v types.FlowLog) Resource { } return resource } -func GetEC2FlowLog(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2FlowLog(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2FlowLogId := field["id"] client := ec2.NewFromConfig(cfg) @@ -1241,7 +1242,7 @@ func GetEC2FlowLog(ctx context.Context, cfg aws.Config, field map[string]string) return nil, nil } - var values []Resource + var values []models.Resource for _, v := range output.FlowLogs { resource := eC2FlowLogHandle(ctx, v) values = append(values, resource) @@ -1249,11 +1250,11 @@ func GetEC2FlowLog(ctx context.Context, cfg aws.Config, field map[string]string) return values, nil } -func EC2Host(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2Host(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeHostsPaginator(client, &ec2.DescribeHostsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1274,10 +1275,10 @@ func EC2Host(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou return values, nil } -func eC2HostHandle(ctx context.Context, v types.Host) Resource { +func eC2HostHandle(ctx context.Context, v types.Host) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:dedicated-host/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.HostId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: arn, Name: *v.HostId, @@ -1287,7 +1288,7 @@ func eC2HostHandle(ctx context.Context, v types.Host) Resource { } return resource } -func GetEC2Host(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2Host(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2HostId := field["id"] client := ec2.NewFromConfig(cfg) @@ -1301,7 +1302,7 @@ func GetEC2Host(ctx context.Context, cfg aws.Config, field map[string]string) ([ return nil, nil } - var values []Resource + var values []models.Resource for _, v := range output.Hosts { resource := eC2HostHandle(ctx, v) values = append(values, resource) @@ -1309,11 +1310,11 @@ func GetEC2Host(ctx context.Context, cfg aws.Config, field map[string]string) ([ return values, nil } -func EC2Instance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2Instance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeInstancesPaginator(client, &ec2.DescribeInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1341,7 +1342,7 @@ func EC2Instance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func eC2InstanceHandle(ctx context.Context, v types.Instance, client *ec2.Client) (*Resource, error) { +func eC2InstanceHandle(ctx context.Context, v types.Instance, client *ec2.Client) (*models.Resource, error) { describeCtx := GetDescribeContext(ctx) var desc model.EC2InstanceDescription @@ -1399,7 +1400,7 @@ func eC2InstanceHandle(ctx context.Context, v types.Instance, client *ec2.Client return nil, err } desc.LaunchTemplateData = *op.LaunchTemplateData - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.InstanceId, @@ -1407,7 +1408,7 @@ func eC2InstanceHandle(ctx context.Context, v types.Instance, client *ec2.Client } return &resource, nil } -func GetEC2Instance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2Instance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { instanceID := fields["id"] client := ec2.NewFromConfig(cfg) @@ -1418,7 +1419,7 @@ func GetEC2Instance(ctx context.Context, cfg aws.Config, fields map[string]strin return nil, err } - var values []Resource + var values []models.Resource for _, r := range out.Reservations { for _, v := range r.Instances { @@ -1436,11 +1437,11 @@ func GetEC2Instance(ctx context.Context, cfg aws.Config, fields map[string]strin return values, nil } -func EC2InternetGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2InternetGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeInternetGatewaysPaginator(client, &ec2.DescribeInternetGatewaysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1461,10 +1462,10 @@ func EC2InternetGateway(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func eC2InternetGatewayHandle(ctx context.Context, v types.InternetGateway) Resource { +func eC2InternetGatewayHandle(ctx context.Context, v types.InternetGateway) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":internet-gateway/" + *v.InternetGatewayId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.InternetGatewayId, @@ -1474,7 +1475,7 @@ func eC2InternetGatewayHandle(ctx context.Context, v types.InternetGateway) Reso } return resource } -func GetEC2InternetGateway(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2InternetGateway(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2InternetGatewayId := field["id"] client := ec2.NewFromConfig(cfg) @@ -1488,7 +1489,7 @@ func GetEC2InternetGateway(ctx context.Context, cfg aws.Config, field map[string return nil, nil } - var values []Resource + var values []models.Resource for _, v := range output.InternetGateways { resource := eC2InternetGatewayHandle(ctx, v) values = append(values, resource) @@ -1496,11 +1497,11 @@ func GetEC2InternetGateway(ctx context.Context, cfg aws.Config, field map[string return values, nil } -func EC2NatGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2NatGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeNatGatewaysPaginator(client, &ec2.DescribeNatGatewaysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1520,10 +1521,10 @@ func EC2NatGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ } return values, nil } -func eC2NatGatewayHandle(ctx context.Context, v types.NatGateway) Resource { +func eC2NatGatewayHandle(ctx context.Context, v types.NatGateway) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":natgateway/" + *v.NatGatewayId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.NatGatewayId, @@ -1533,7 +1534,7 @@ func eC2NatGatewayHandle(ctx context.Context, v types.NatGateway) Resource { } return resource } -func GetEC2NatGateway(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2NatGateway(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2NatGatewayId := field["id"] client := ec2.NewFromConfig(cfg) @@ -1547,7 +1548,7 @@ func GetEC2NatGateway(ctx context.Context, cfg aws.Config, field map[string]stri return nil, nil } - var values []Resource + var values []models.Resource for _, v := range output.NatGateways { resource := eC2NatGatewayHandle(ctx, v) values = append(values, resource) @@ -1555,11 +1556,11 @@ func GetEC2NatGateway(ctx context.Context, cfg aws.Config, field map[string]stri return values, nil } -func EC2NetworkAcl(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2NetworkAcl(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeNetworkAclsPaginator(client, &ec2.DescribeNetworkAclsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1580,10 +1581,10 @@ func EC2NetworkAcl(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func eC2NetworkAclHandle(ctx context.Context, v types.NetworkAcl) Resource { +func eC2NetworkAclHandle(ctx context.Context, v types.NetworkAcl) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":network-acl/" + *v.NetworkAclId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.NetworkAclId, @@ -1593,7 +1594,7 @@ func eC2NetworkAclHandle(ctx context.Context, v types.NetworkAcl) Resource { } return resource } -func GetEC2NetworkAcl(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2NetworkAcl(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2NetworkAclId := field["id"] client := ec2.NewFromConfig(cfg) @@ -1607,7 +1608,7 @@ func GetEC2NetworkAcl(ctx context.Context, cfg aws.Config, field map[string]stri return nil, nil } - var values []Resource + var values []models.Resource for _, v := range output.NetworkAcls { resource := eC2NetworkAclHandle(ctx, v) values = append(values, resource) @@ -1615,12 +1616,12 @@ func GetEC2NetworkAcl(ctx context.Context, cfg aws.Config, field map[string]stri return values, nil } -func EC2NetworkInsightsAnalysis(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2NetworkInsightsAnalysis(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeNetworkInsightsAnalysesPaginator(client, &ec2.DescribeNetworkInsightsAnalysesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1628,7 +1629,7 @@ func EC2NetworkInsightsAnalysis(ctx context.Context, cfg aws.Config, stream *Str } for _, v := range page.NetworkInsightsAnalyses { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.NetworkInsightsAnalysisArn, Name: *v.NetworkInsightsAnalysisArn, @@ -1647,12 +1648,12 @@ func EC2NetworkInsightsAnalysis(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func EC2NetworkInsightsPath(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2NetworkInsightsPath(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeNetworkInsightsPathsPaginator(client, &ec2.DescribeNetworkInsightsPathsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1660,7 +1661,7 @@ func EC2NetworkInsightsPath(ctx context.Context, cfg aws.Config, stream *StreamS } for _, v := range page.NetworkInsightsPaths { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.NetworkInsightsPathArn, Name: *v.NetworkInsightsPathArn, @@ -1679,7 +1680,7 @@ func EC2NetworkInsightsPath(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func EC2NetworkInterface(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2NetworkInterface(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { logger := GetLoggerFromContext(ctx) logger.Info("EC2NetworkInterface start working") @@ -1688,7 +1689,7 @@ func EC2NetworkInterface(ctx context.Context, cfg aws.Config, stream *StreamSend paginator := ec2.NewDescribeNetworkInterfacesPaginator(client, &ec2.DescribeNetworkInterfacesInput{}) logger.Info("EC2NetworkInterface start getting pages") - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1711,10 +1712,10 @@ func EC2NetworkInterface(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func eC2NetworkInterfaceHandle(ctx context.Context, v types.NetworkInterface) Resource { +func eC2NetworkInterfaceHandle(ctx context.Context, v types.NetworkInterface) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":network-interface/" + *v.NetworkInterfaceId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.NetworkInterfaceId, @@ -1724,7 +1725,7 @@ func eC2NetworkInterfaceHandle(ctx context.Context, v types.NetworkInterface) Re } return resource } -func GetEC2NetworkInterface(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2NetworkInterface(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { networkInterfaceID := fields["id"] client := ec2.NewFromConfig(cfg) out, err := client.DescribeNetworkInterfaces(ctx, &ec2.DescribeNetworkInterfacesInput{ @@ -1734,7 +1735,7 @@ func GetEC2NetworkInterface(ctx context.Context, cfg aws.Config, fields map[stri return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.NetworkInterfaces { resource := eC2NetworkInterfaceHandle(ctx, v) values = append(values, resource) @@ -1742,12 +1743,12 @@ func GetEC2NetworkInterface(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func EC2NetworkInterfacePermission(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2NetworkInterfacePermission(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeNetworkInterfacePermissionsPaginator(client, &ec2.DescribeNetworkInterfacePermissionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1755,7 +1756,7 @@ func EC2NetworkInterfacePermission(ctx context.Context, cfg aws.Config, stream * } for _, v := range page.NetworkInterfacePermissions { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.NetworkInterfacePermissionId, Name: *v.NetworkInterfacePermissionId, @@ -1773,14 +1774,14 @@ func EC2NetworkInterfacePermission(ctx context.Context, cfg aws.Config, stream * return values, nil } -func EC2PlacementGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2PlacementGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) output, err := client.DescribePlacementGroups(ctx, &ec2.DescribePlacementGroupsInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.PlacementGroups { resource := eC2PlacementGroupHandle(ctx, v) if stream != nil { @@ -1794,10 +1795,10 @@ func EC2PlacementGroup(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func eC2PlacementGroupHandle(ctx context.Context, v types.PlacementGroup) Resource { +func eC2PlacementGroupHandle(ctx context.Context, v types.PlacementGroup) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:placement-group/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.GroupName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: arn, Name: *v.GroupName, @@ -1807,7 +1808,7 @@ func eC2PlacementGroupHandle(ctx context.Context, v types.PlacementGroup) Resour } return resource } -func GetEC2PlacementGroup(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2PlacementGroup(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2PlacementGroupId := field["group_id"] client := ec2.NewFromConfig(cfg) @@ -1821,7 +1822,7 @@ func GetEC2PlacementGroup(ctx context.Context, cfg aws.Config, field map[string] return nil, nil } - var values []Resource + var values []models.Resource for _, v := range output.PlacementGroups { resource := eC2PlacementGroupHandle(ctx, v) values = append(values, resource) @@ -1829,12 +1830,12 @@ func GetEC2PlacementGroup(ctx context.Context, cfg aws.Config, field map[string] return values, nil } -func EC2PrefixList(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2PrefixList(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribePrefixListsPaginator(client, &ec2.DescribePrefixListsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1842,7 +1843,7 @@ func EC2PrefixList(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ } for _, v := range page.PrefixLists { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.PrefixListId, Name: *v.PrefixListName, @@ -1861,7 +1862,7 @@ func EC2PrefixList(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func EC2RegionalSettings(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2RegionalSettings(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) out, err := client.GetEbsEncryptionByDefault(ctx, &ec2.GetEbsEncryptionByDefaultInput{}) @@ -1877,7 +1878,7 @@ func EC2RegionalSettings(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, // No ID or ARN. Per Account Configuration Name: cfg.Region + " EC2 Settings", // Based on Steampipe @@ -1887,7 +1888,7 @@ func EC2RegionalSettings(ctx context.Context, cfg aws.Config, stream *StreamSend SnapshotBlockPublicAccessState: outstate.State, }, } - var values []Resource + var values []models.Resource if stream != nil { if err := (*stream)(resource); err != nil { return nil, err @@ -1899,11 +1900,11 @@ func EC2RegionalSettings(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func EC2RouteTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2RouteTable(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeRouteTablesPaginator(client, &ec2.DescribeRouteTablesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1924,11 +1925,11 @@ func EC2RouteTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func eC2RouteTableHandle(ctx context.Context, v types.RouteTable) Resource { +func eC2RouteTableHandle(ctx context.Context, v types.RouteTable) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":route-table/" + *v.RouteTableId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.RouteTableId, @@ -1938,7 +1939,7 @@ func eC2RouteTableHandle(ctx context.Context, v types.RouteTable) Resource { } return resource } -func GetEC2RouteTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2RouteTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) routeTableID := fields["id"] @@ -1948,7 +1949,7 @@ func GetEC2RouteTable(ctx context.Context, cfg aws.Config, fields map[string]str return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.RouteTables { resource := eC2RouteTableHandle(ctx, v) values = append(values, resource) @@ -1957,12 +1958,12 @@ func GetEC2RouteTable(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func EC2LocalGatewayRouteTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2LocalGatewayRouteTable(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeLocalGatewayRouteTablesPaginator(client, &ec2.DescribeLocalGatewayRouteTablesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1970,7 +1971,7 @@ func EC2LocalGatewayRouteTable(ctx context.Context, cfg aws.Config, stream *Stre } for _, v := range page.LocalGatewayRouteTables { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.LocalGatewayRouteTableArn, Name: *v.LocalGatewayRouteTableId, @@ -1989,12 +1990,12 @@ func EC2LocalGatewayRouteTable(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func EC2LocalGatewayRouteTableVPCAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2LocalGatewayRouteTableVPCAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator(client, &ec2.DescribeLocalGatewayRouteTableVpcAssociationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2002,7 +2003,7 @@ func EC2LocalGatewayRouteTableVPCAssociation(ctx context.Context, cfg aws.Config } for _, v := range page.LocalGatewayRouteTableVpcAssociations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.LocalGatewayRouteTableVpcAssociationId, Name: *v.LocalGatewayRouteTableVpcAssociationId, @@ -2021,11 +2022,11 @@ func EC2LocalGatewayRouteTableVPCAssociation(ctx context.Context, cfg aws.Config return values, nil } -func EC2TransitGatewayRouteTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayRouteTable(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTransitGatewayRouteTablesPaginator(client, &ec2.DescribeTransitGatewayRouteTablesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2049,11 +2050,11 @@ func EC2TransitGatewayRouteTable(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func eC2TransitGatewayRouteTableHandle(ctx context.Context, v types.TransitGatewayRouteTable) Resource { +func eC2TransitGatewayRouteTableHandle(ctx context.Context, v types.TransitGatewayRouteTable) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:transit-gateway-route-table/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.TransitGatewayRouteTableId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.TransitGatewayRouteTableId, @@ -2063,7 +2064,7 @@ func eC2TransitGatewayRouteTableHandle(ctx context.Context, v types.TransitGatew } return resource } -func GetEC2TransitGatewayRouteTable(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEC2TransitGatewayRouteTable(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { EC2TransitGatewayRouteTableId := field["id"] client := ec2.NewFromConfig(cfg) @@ -2077,14 +2078,14 @@ func GetEC2TransitGatewayRouteTable(ctx context.Context, cfg aws.Config, field m return nil, nil } - var values []Resource + var values []models.Resource for _, v := range out.TransitGatewayRouteTables { resource := eC2TransitGatewayRouteTableHandle(ctx, v) values = append(values, resource) } return values, nil } -func EC2TransitGatewayRouteTableAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayRouteTableAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) rts, err := EC2TransitGatewayRouteTable(ctx, cfg, nil) if err != nil { @@ -2093,7 +2094,7 @@ func EC2TransitGatewayRouteTableAssociation(ctx context.Context, cfg aws.Config, client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, r := range rts { routeTable := r.Description.(types.TransitGatewayRouteTable) paginator := ec2.NewGetTransitGatewayRouteTableAssociationsPaginator(client, &ec2.GetTransitGatewayRouteTableAssociationsInput{ @@ -2106,7 +2107,7 @@ func EC2TransitGatewayRouteTableAssociation(ctx context.Context, cfg aws.Config, } for _, v := range page.Associations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.TransitGatewayAttachmentId, Name: *v.TransitGatewayAttachmentId, @@ -2126,7 +2127,7 @@ func EC2TransitGatewayRouteTableAssociation(ctx context.Context, cfg aws.Config, return values, nil } -func EC2TransitGatewayRouteTablePropagation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayRouteTablePropagation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) rts, err := EC2TransitGatewayRouteTable(ctx, cfg, nil) if err != nil { @@ -2135,7 +2136,7 @@ func EC2TransitGatewayRouteTablePropagation(ctx context.Context, cfg aws.Config, client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, r := range rts { routeTable := r.Description.(types.TransitGatewayRouteTable) paginator := ec2.NewGetTransitGatewayRouteTablePropagationsPaginator(client, &ec2.GetTransitGatewayRouteTablePropagationsInput{ @@ -2149,7 +2150,7 @@ func EC2TransitGatewayRouteTablePropagation(ctx context.Context, cfg aws.Config, } for _, v := range page.TransitGatewayRouteTablePropagations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*routeTable.TransitGatewayRouteTableId, *v.TransitGatewayAttachmentId), Name: *routeTable.TransitGatewayRouteTableId, @@ -2169,11 +2170,11 @@ func EC2TransitGatewayRouteTablePropagation(ctx context.Context, cfg aws.Config, return values, nil } -func EC2SecurityGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2SecurityGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeSecurityGroupsPaginator(client, &ec2.DescribeSecurityGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2194,10 +2195,10 @@ func EC2SecurityGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func eC2SecurityGroupHandle(ctx context.Context, v types.SecurityGroup) Resource { +func eC2SecurityGroupHandle(ctx context.Context, v types.SecurityGroup) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:security-group/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.GroupId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.GroupName, @@ -2207,7 +2208,7 @@ func eC2SecurityGroupHandle(ctx context.Context, v types.SecurityGroup) Resource } return resource } -func GetEC2SecurityGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2SecurityGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { groupID := fields["group_id"] client := ec2.NewFromConfig(cfg) @@ -2218,7 +2219,7 @@ func GetEC2SecurityGroup(ctx context.Context, cfg aws.Config, fields map[string] return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.SecurityGroups { resource := eC2SecurityGroupHandle(ctx, v) values = append(values, resource) @@ -2293,13 +2294,13 @@ func getEC2SecurityGroupRuleDescriptionFromIPPermission(group types.SecurityGrou return descArr } -func EC2SecurityGroupRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2SecurityGroupRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { groups, err := EC2SecurityGroup(ctx, cfg, nil) if err != nil { return nil, err } - var values []Resource + var values []models.Resource descArr := make([]model.EC2SecurityGroupRuleDescription, 0, 128) for _, groupWrapper := range groups { group := groupWrapper.Description.(model.EC2SecurityGroupDescription).SecurityGroup @@ -2326,7 +2327,7 @@ func EC2SecurityGroupRule(ctx context.Context, cfg aws.Config, stream *StreamSen } return values, nil } -func eC2SecurityGroupRuleHandle(ctx context.Context, desc model.EC2SecurityGroupRuleDescription) Resource { +func eC2SecurityGroupRuleHandle(ctx context.Context, desc model.EC2SecurityGroupRuleDescription) models.Resource { describeCtx := GetDescribeContext(ctx) hashCode := desc.Type + "_" + *desc.Permission.IpProtocol @@ -2345,7 +2346,7 @@ func eC2SecurityGroupRuleHandle(ctx context.Context, desc model.EC2SecurityGroup } arn := fmt.Sprintf("arn:%s:ec2:%s:%s:security-group/%s:%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *desc.Group.GroupId, hashCode) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: fmt.Sprintf("%s_%s", *desc.Group.GroupId, hashCode), @@ -2353,7 +2354,7 @@ func eC2SecurityGroupRuleHandle(ctx context.Context, desc model.EC2SecurityGroup } return resource } -func GetEC2SecurityGroupRule(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2SecurityGroupRule(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) groupName := fields["name"] @@ -2381,7 +2382,7 @@ func GetEC2SecurityGroupRule(ctx context.Context, cfg aws.Config, fields map[str } } - var values []Resource + var values []models.Resource for _, desc := range descArr { resource := eC2SecurityGroupRuleHandle(ctx, desc) values = append(values, resource) @@ -2389,12 +2390,12 @@ func GetEC2SecurityGroupRule(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func EC2SpotFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2SpotFleet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeSpotFleetRequestsPaginator(client, &ec2.DescribeSpotFleetRequestsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2402,7 +2403,7 @@ func EC2SpotFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] } for _, v := range page.SpotFleetRequestConfigs { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.SpotFleetRequestId, Name: *v.SpotFleetRequestId, @@ -2421,11 +2422,11 @@ func EC2SpotFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func EC2Subnet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2Subnet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeSubnetsPaginator(client, &ec2.DescribeSubnetsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2446,9 +2447,9 @@ func EC2Subnet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return values, nil } -func eC2SubnetHandle(ctx context.Context, v types.Subnet) Resource { +func eC2SubnetHandle(ctx context.Context, v types.Subnet) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.SubnetArn, Name: *v.SubnetId, @@ -2458,7 +2459,7 @@ func eC2SubnetHandle(ctx context.Context, v types.Subnet) Resource { } return resource } -func GetEC2Subnet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2Subnet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { subnetId := fields["id"] client := ec2.NewFromConfig(cfg) out, err := client.DescribeSubnets(ctx, &ec2.DescribeSubnetsInput{ @@ -2468,7 +2469,7 @@ func GetEC2Subnet(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Subnets { resource := eC2SubnetHandle(ctx, v) @@ -2478,12 +2479,12 @@ func GetEC2Subnet(ctx context.Context, cfg aws.Config, fields map[string]string) return values, nil } -func EC2TrafficMirrorFilter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TrafficMirrorFilter(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTrafficMirrorFiltersPaginator(client, &ec2.DescribeTrafficMirrorFiltersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2491,7 +2492,7 @@ func EC2TrafficMirrorFilter(ctx context.Context, cfg aws.Config, stream *StreamS } for _, v := range page.TrafficMirrorFilters { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.TrafficMirrorFilterId, Name: *v.TrafficMirrorFilterId, @@ -2510,12 +2511,12 @@ func EC2TrafficMirrorFilter(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func EC2TrafficMirrorSession(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TrafficMirrorSession(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTrafficMirrorSessionsPaginator(client, &ec2.DescribeTrafficMirrorSessionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2523,7 +2524,7 @@ func EC2TrafficMirrorSession(ctx context.Context, cfg aws.Config, stream *Stream } for _, v := range page.TrafficMirrorSessions { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.TrafficMirrorSessionId, Name: *v.TrafficMirrorFilterId, @@ -2542,12 +2543,12 @@ func EC2TrafficMirrorSession(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func EC2TrafficMirrorTarget(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TrafficMirrorTarget(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTrafficMirrorTargetsPaginator(client, &ec2.DescribeTrafficMirrorTargetsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2555,7 +2556,7 @@ func EC2TrafficMirrorTarget(ctx context.Context, cfg aws.Config, stream *StreamS } for _, v := range page.TrafficMirrorTargets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.TrafficMirrorTargetId, Name: *v.TrafficMirrorTargetId, @@ -2574,11 +2575,11 @@ func EC2TrafficMirrorTarget(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func EC2TransitGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTransitGatewaysPaginator(client, &ec2.DescribeTransitGatewaysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2602,9 +2603,9 @@ func EC2TransitGateway(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func eC2TransitGatewayHandle(ctx context.Context, v types.TransitGateway) Resource { +func eC2TransitGatewayHandle(ctx context.Context, v types.TransitGateway) models.Resource { describeCtx := GetDescribeContext(ctx) - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TransitGatewayArn, Name: *v.TransitGatewayId, @@ -2614,7 +2615,7 @@ func eC2TransitGatewayHandle(ctx context.Context, v types.TransitGateway) Resour } return values } -func GetEC2TransitGateway(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2TransitGateway(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { ransitGatewayId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -2628,19 +2629,19 @@ func GetEC2TransitGateway(ctx context.Context, cfg aws.Config, fields map[string return nil, nil } - var values []Resource + var values []models.Resource for _, v := range out.TransitGateways { resource := eC2TransitGatewayHandle(ctx, v) values = append(values, resource) } return values, nil } -func EC2TransitGatewayConnect(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayConnect(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTransitGatewayConnectsPaginator(client, &ec2.DescribeTransitGatewayConnectsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2648,7 +2649,7 @@ func EC2TransitGatewayConnect(ctx context.Context, cfg aws.Config, stream *Strea } for _, v := range page.TransitGatewayConnects { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.TransitGatewayAttachmentId, Name: *v.TransitGatewayAttachmentId, @@ -2667,12 +2668,12 @@ func EC2TransitGatewayConnect(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func EC2TransitGatewayMulticastDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayMulticastDomain(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTransitGatewayMulticastDomainsPaginator(client, &ec2.DescribeTransitGatewayMulticastDomainsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2680,7 +2681,7 @@ func EC2TransitGatewayMulticastDomain(ctx context.Context, cfg aws.Config, strea } for _, v := range page.TransitGatewayMulticastDomains { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TransitGatewayMulticastDomainArn, Name: *v.TransitGatewayMulticastDomainArn, @@ -2699,7 +2700,7 @@ func EC2TransitGatewayMulticastDomain(ctx context.Context, cfg aws.Config, strea return values, nil } -func EC2TransitGatewayMulticastDomainAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayMulticastDomainAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) domains, err := EC2TransitGatewayMulticastDomain(ctx, cfg, nil) if err != nil { @@ -2707,7 +2708,7 @@ func EC2TransitGatewayMulticastDomainAssociation(ctx context.Context, cfg aws.Co } client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, domain := range domains { paginator := ec2.NewGetTransitGatewayMulticastDomainAssociationsPaginator(client, &ec2.GetTransitGatewayMulticastDomainAssociationsInput{ TransitGatewayMulticastDomainId: domain.Description.(types.TransitGatewayMulticastDomain).TransitGatewayMulticastDomainId, @@ -2720,7 +2721,7 @@ func EC2TransitGatewayMulticastDomainAssociation(ctx context.Context, cfg aws.Co } for _, v := range page.MulticastDomainAssociations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.TransitGatewayAttachmentId, Name: *v.TransitGatewayAttachmentId, @@ -2740,7 +2741,7 @@ func EC2TransitGatewayMulticastDomainAssociation(ctx context.Context, cfg aws.Co return values, nil } -func EC2TransitGatewayMulticastGroupMember(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayMulticastGroupMember(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) domains, err := EC2TransitGatewayMulticastDomain(ctx, cfg, nil) if err != nil { @@ -2748,7 +2749,7 @@ func EC2TransitGatewayMulticastGroupMember(ctx context.Context, cfg aws.Config, } client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, domain := range domains { tgmdID := domain.Description.(types.TransitGatewayMulticastDomain).TransitGatewayMulticastDomainId paginator := ec2.NewSearchTransitGatewayMulticastGroupsPaginator(client, &ec2.SearchTransitGatewayMulticastGroupsInput{ @@ -2768,7 +2769,7 @@ func EC2TransitGatewayMulticastGroupMember(ctx context.Context, cfg aws.Config, } for _, v := range page.MulticastGroups { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*tgmdID, *v.GroupIpAddress), Name: *v.GroupIpAddress, @@ -2788,7 +2789,7 @@ func EC2TransitGatewayMulticastGroupMember(ctx context.Context, cfg aws.Config, return values, nil } -func EC2TransitGatewayMulticastGroupSource(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayMulticastGroupSource(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) domains, err := EC2TransitGatewayMulticastDomain(ctx, cfg, nil) if err != nil { @@ -2796,7 +2797,7 @@ func EC2TransitGatewayMulticastGroupSource(ctx context.Context, cfg aws.Config, } client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, domain := range domains { tgmdID := domain.Description.(types.TransitGatewayMulticastDomain).TransitGatewayMulticastDomainId paginator := ec2.NewSearchTransitGatewayMulticastGroupsPaginator(client, &ec2.SearchTransitGatewayMulticastGroupsInput{ @@ -2816,7 +2817,7 @@ func EC2TransitGatewayMulticastGroupSource(ctx context.Context, cfg aws.Config, } for _, v := range page.MulticastGroups { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*tgmdID, *v.GroupIpAddress), Name: *v.GroupIpAddress, @@ -2836,12 +2837,12 @@ func EC2TransitGatewayMulticastGroupSource(ctx context.Context, cfg aws.Config, return values, nil } -func EC2TransitGatewayPeeringAttachment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayPeeringAttachment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTransitGatewayPeeringAttachmentsPaginator(client, &ec2.DescribeTransitGatewayPeeringAttachmentsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2849,7 +2850,7 @@ func EC2TransitGatewayPeeringAttachment(ctx context.Context, cfg aws.Config, str } for _, v := range page.TransitGatewayPeeringAttachments { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.TransitGatewayAttachmentId, Name: *v.TransitGatewayAttachmentId, @@ -2868,11 +2869,11 @@ func EC2TransitGatewayPeeringAttachment(ctx context.Context, cfg aws.Config, str return values, nil } -func EC2VPC(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPC(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVpcsPaginator(client, &ec2.DescribeVpcsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2892,10 +2893,10 @@ func EC2VPC(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour } return values, nil } -func eC2VPCHandle(ctx context.Context, v types.Vpc) Resource { +func eC2VPCHandle(ctx context.Context, v types.Vpc) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":vpc/" + *v.VpcId - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.VpcId, @@ -2905,7 +2906,7 @@ func eC2VPCHandle(ctx context.Context, v types.Vpc) Resource { } return values } -func GetEC2VPC(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2VPC(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) vpcID := fields["id"] @@ -2917,7 +2918,7 @@ func GetEC2VPC(ctx context.Context, cfg aws.Config, fields map[string]string) ([ return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Vpcs { resource := eC2VPCHandle(ctx, v) values = append(values, resource) @@ -2925,11 +2926,11 @@ func GetEC2VPC(ctx context.Context, cfg aws.Config, fields map[string]string) ([ return values, nil } -func EC2VPCEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPCEndpoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVpcEndpointsPaginator(client, &ec2.DescribeVpcEndpointsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2950,10 +2951,10 @@ func EC2VPCEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } return values, nil } -func eC2VPCEndpointHandle(ctx context.Context, v types.VpcEndpoint) Resource { +func eC2VPCEndpointHandle(ctx context.Context, v types.VpcEndpoint) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":vpc-endpoint/" + *v.VpcEndpointId - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *v.VpcEndpointId, @@ -2964,7 +2965,7 @@ func eC2VPCEndpointHandle(ctx context.Context, v types.VpcEndpoint) Resource { } return values } -func GetEC2VPCEndpoint(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2VPCEndpoint(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { VPCEndpointId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -2975,7 +2976,7 @@ func GetEC2VPCEndpoint(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.VpcEndpoints { resource := eC2VPCEndpointHandle(ctx, v) values = append(values, resource) @@ -2983,12 +2984,12 @@ func GetEC2VPCEndpoint(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func EC2VPCEndpointConnectionNotification(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPCEndpointConnectionNotification(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVpcEndpointConnectionNotificationsPaginator(client, &ec2.DescribeVpcEndpointConnectionNotificationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -2996,7 +2997,7 @@ func EC2VPCEndpointConnectionNotification(ctx context.Context, cfg aws.Config, s } for _, v := range page.ConnectionNotificationSet { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ConnectionNotificationArn, Name: *v.ConnectionNotificationArn, @@ -3015,12 +3016,12 @@ func EC2VPCEndpointConnectionNotification(ctx context.Context, cfg aws.Config, s return values, nil } -func EC2VPCEndpointService(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPCEndpointService(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { fmt.Println("EC2VPCEndpointService") describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource fmt.Println("EC2VPCEndpointService DescribeVpcEndpointServices") output, err := client.DescribeVpcEndpointServices(ctx, &ec2.DescribeVpcEndpointServicesInput{}) @@ -3092,7 +3093,7 @@ func EC2VPCEndpointService(ctx context.Context, cfg aws.Config, stream *StreamSe } fmt.Println("EC2VPCEndpointService DescribeVpcEndpointConnections done") - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Description: model.EC2VPCEndpointServiceDescription{ @@ -3125,7 +3126,7 @@ func EC2VPCEndpointService(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func EC2VPCEndpointServicePermissions(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPCEndpointServicePermissions(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) services, err := EC2VPCEndpointService(ctx, cfg, nil) if err != nil { @@ -3134,7 +3135,7 @@ func EC2VPCEndpointServicePermissions(ctx context.Context, cfg aws.Config, strea client := ec2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, s := range services { service := s.Description.(model.EC2VPCEndpointServiceDescription).VpcEndpointService @@ -3153,7 +3154,7 @@ func EC2VPCEndpointServicePermissions(ctx context.Context, cfg aws.Config, strea } for _, v := range page.AllowedPrincipals { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Principal, Name: *v.Principal, @@ -3173,11 +3174,11 @@ func EC2VPCEndpointServicePermissions(ctx context.Context, cfg aws.Config, strea return values, nil } -func EC2VPCPeeringConnection(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPCPeeringConnection(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVpcPeeringConnectionsPaginator(client, &ec2.DescribeVpcPeeringConnectionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -3198,10 +3199,10 @@ func EC2VPCPeeringConnection(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func eC2VPCPeeringConnectionHandle(ctx context.Context, v types.VpcPeeringConnection) Resource { +func eC2VPCPeeringConnectionHandle(ctx context.Context, v types.VpcPeeringConnection) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:vpc-peering-connection/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.VpcPeeringConnectionId) - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.VpcPeeringConnectionId, @@ -3211,7 +3212,7 @@ func eC2VPCPeeringConnectionHandle(ctx context.Context, v types.VpcPeeringConnec } return values } -func GetEC2VPCPeeringConnection(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2VPCPeeringConnection(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { VPCPeeringConnectionId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3222,7 +3223,7 @@ func GetEC2VPCPeeringConnection(ctx context.Context, cfg aws.Config, fields map[ return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.VpcPeeringConnections { resource := eC2VPCPeeringConnectionHandle(ctx, v) values = append(values, resource) @@ -3230,14 +3231,14 @@ func GetEC2VPCPeeringConnection(ctx context.Context, cfg aws.Config, fields map[ return values, nil } -func EC2VPNConnection(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPNConnection(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) output, err := client.DescribeVpnConnections(ctx, &ec2.DescribeVpnConnectionsInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.VpnConnections { resource := eC2VPNConnectionHandle(ctx, v) if stream != nil { @@ -3251,10 +3252,10 @@ func EC2VPNConnection(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func eC2VPNConnectionHandle(ctx context.Context, v types.VpnConnection) Resource { +func eC2VPNConnectionHandle(ctx context.Context, v types.VpnConnection) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":vpn-connection/" + *v.VpnConnectionId - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.VpnConnectionId, @@ -3264,7 +3265,7 @@ func eC2VPNConnectionHandle(ctx context.Context, v types.VpnConnection) Resource } return values } -func GetEC2VPNConnection(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2VPNConnection(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { VPNConnectionId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3275,7 +3276,7 @@ func GetEC2VPNConnection(ctx context.Context, cfg aws.Config, fields map[string] return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.VpnConnections { resource := eC2VPNConnectionHandle(ctx, v) values = append(values, resource) @@ -3283,14 +3284,14 @@ func GetEC2VPNConnection(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func EC2VPNGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPNGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) output, err := client.DescribeVpnGateways(ctx, &ec2.DescribeVpnGatewaysInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.VpnGateways { resource := eC2VPNGatewayHandle(ctx, v) @@ -3305,10 +3306,10 @@ func EC2VPNGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func eC2VPNGatewayHandle(ctx context.Context, v types.VpnGateway) Resource { +func eC2VPNGatewayHandle(ctx context.Context, v types.VpnGateway) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:vpn-gateway/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.VpnGatewayId) - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *v.VpnGatewayId, @@ -3319,7 +3320,7 @@ func eC2VPNGatewayHandle(ctx context.Context, v types.VpnGateway) Resource { } return values } -func GetEC2VPNGateway(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2VPNGateway(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { VPNGatewayId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3330,7 +3331,7 @@ func GetEC2VPNGateway(ctx context.Context, cfg aws.Config, fields map[string]str return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.VpnGateways { resource := eC2VPNGatewayHandle(ctx, v) values = append(values, resource) @@ -3338,7 +3339,7 @@ func GetEC2VPNGateway(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func EC2Region(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2Region(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) output, err := client.DescribeRegions(ctx, &ec2.DescribeRegionsInput{ @@ -3348,10 +3349,10 @@ func EC2Region(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.Regions { arn := "arn:" + describeCtx.Partition + "::" + *v.RegionName + ":" + describeCtx.AccountID - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.RegionName, @@ -3371,7 +3372,7 @@ func EC2Region(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return values, nil } -func EC2AvailabilityZone(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2AvailabilityZone(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) regionsOutput, err := client.DescribeRegions(ctx, &ec2.DescribeRegionsInput{ @@ -3381,7 +3382,7 @@ func EC2AvailabilityZone(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - var values []Resource + var values []models.Resource for _, region := range regionsOutput.Regions { if region.OptInStatus != nil && *region.OptInStatus != "not-opted-in" { continue @@ -3412,10 +3413,10 @@ func EC2AvailabilityZone(ctx context.Context, cfg aws.Config, stream *StreamSend } return values, nil } -func eC2AvailabilityZoneHandle(ctx context.Context, v types.AvailabilityZone, region types.Region) Resource { +func eC2AvailabilityZoneHandle(ctx context.Context, v types.AvailabilityZone, region types.Region) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s::%s::availability-zone/%s", describeCtx.Partition, *region.RegionName, *v.ZoneName) - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.RegionName, @@ -3425,7 +3426,7 @@ func eC2AvailabilityZoneHandle(ctx context.Context, v types.AvailabilityZone, re } return values } -func GetEC2AvailabilityZone(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2AvailabilityZone(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { ZoneIds := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3436,7 +3437,7 @@ func GetEC2AvailabilityZone(ctx context.Context, cfg aws.Config, fields map[stri return nil, err } - var values []Resource + var values []models.Resource for _, region := range regionsOutput.Regions { if region.OptInStatus != nil && *region.OptInStatus != "not-opted-in" { continue @@ -3462,14 +3463,14 @@ func GetEC2AvailabilityZone(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func EC2KeyPair(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2KeyPair(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) output, err := client.DescribeKeyPairs(ctx, &ec2.DescribeKeyPairsInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.KeyPairs { resource := eC2KeyPairHandle(ctx, v) if stream != nil { @@ -3483,10 +3484,10 @@ func EC2KeyPair(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func eC2KeyPairHandle(ctx context.Context, v types.KeyPairInfo) Resource { +func eC2KeyPairHandle(ctx context.Context, v types.KeyPairInfo) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":key-pair/" + *v.KeyName - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.KeyName, @@ -3496,7 +3497,7 @@ func eC2KeyPairHandle(ctx context.Context, v types.KeyPairInfo) Resource { } return resource } -func GetEC2KeyPair(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2KeyPair(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { keyPairID := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3507,7 +3508,7 @@ func GetEC2KeyPair(ctx context.Context, cfg aws.Config, fields map[string]string return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.KeyPairs { resource := eC2KeyPairHandle(ctx, v) values = append(values, resource) @@ -3516,7 +3517,7 @@ func GetEC2KeyPair(ctx context.Context, cfg aws.Config, fields map[string]string return values, nil } -func EC2AMI(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2AMI(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) output, err := client.DescribeImages(ctx, &ec2.DescribeImagesInput{ Owners: []string{"self"}, @@ -3528,7 +3529,7 @@ func EC2AMI(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.Images { imageAttribute, err := client.DescribeImageAttribute(ctx, &ec2.DescribeImageAttributeInput{ @@ -3553,10 +3554,10 @@ func EC2AMI(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour return values, nil } -func eC2AMIHandle(ctx context.Context, v types.Image, imageAttribute *ec2.DescribeImageAttributeOutput) Resource { +func eC2AMIHandle(ctx context.Context, v types.Image, imageAttribute *ec2.DescribeImageAttributeOutput) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":image/" + *v.ImageId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.ImageId, @@ -3568,7 +3569,7 @@ func eC2AMIHandle(ctx context.Context, v types.Image, imageAttribute *ec2.Descri return resource } -func GetEC2AMI(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2AMI(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { AMIId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3582,7 +3583,7 @@ func GetEC2AMI(ctx context.Context, cfg aws.Config, fields map[string]string) ([ return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Images { imageAttribute, err := client.DescribeImageAttribute(ctx, &ec2.DescribeImageAttributeInput{ Attribute: types.ImageAttributeNameLaunchPermission, @@ -3600,7 +3601,7 @@ func GetEC2AMI(ctx context.Context, cfg aws.Config, fields map[string]string) ([ return values, nil } -func EC2ReservedInstances(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2ReservedInstances(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) output, err := client.DescribeReservedInstances(ctx, &ec2.DescribeReservedInstancesInput{}) if err != nil { @@ -3610,7 +3611,7 @@ func EC2ReservedInstances(ctx context.Context, cfg aws.Config, stream *StreamSen return nil, err } - var values []Resource + var values []models.Resource filterName := "reserved-instances-id" for _, v := range output.ReservedInstances { @@ -3647,11 +3648,11 @@ func EC2ReservedInstances(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func eC2ReservedInstancesHandle(ctx context.Context, v types.ReservedInstances, modifications []types.ReservedInstancesModification) Resource { +func eC2ReservedInstancesHandle(ctx context.Context, v types.ReservedInstances, modifications []types.ReservedInstancesModification) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":ec2:" + describeCtx.Region + ":" + describeCtx.AccountID + ":reserved-instances/" + *v.ReservedInstancesId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.ReservedInstancesId, @@ -3662,7 +3663,7 @@ func eC2ReservedInstancesHandle(ctx context.Context, v types.ReservedInstances, } return resource } -func GetEC2ReservedInstances(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2ReservedInstances(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { ReservedInstancesId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3673,7 +3674,7 @@ func GetEC2ReservedInstances(ctx context.Context, cfg aws.Config, fields map[str return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.ReservedInstances { filterName := "reserved-instances-id" var modifications []types.ReservedInstancesModification @@ -3699,11 +3700,11 @@ func GetEC2ReservedInstances(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func EC2IpamPool(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2IpamPool(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeIpamPoolsPaginator(client, &ec2.DescribeIpamPoolsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -3723,9 +3724,9 @@ func EC2IpamPool(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R } return values, nil } -func eC2IpamPoolHandle(ctx context.Context, v types.IpamPool) Resource { +func eC2IpamPoolHandle(ctx context.Context, v types.IpamPool) models.Resource { describeCtx := GetDescribeContext(ctx) - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.IpamPoolArn, Name: *v.IpamPoolId, @@ -3735,7 +3736,7 @@ func eC2IpamPoolHandle(ctx context.Context, v types.IpamPool) Resource { } return values } -func GetEC2IpamPool(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2IpamPool(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { IpamPoolId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3746,7 +3747,7 @@ func GetEC2IpamPool(ctx context.Context, cfg aws.Config, fields map[string]strin return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.IpamPools { resource := eC2IpamPoolHandle(ctx, v) values = append(values, resource) @@ -3754,11 +3755,11 @@ func GetEC2IpamPool(ctx context.Context, cfg aws.Config, fields map[string]strin return values, nil } -func EC2Ipam(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2Ipam(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeIpamsPaginator(client, &ec2.DescribeIpamsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -3778,9 +3779,9 @@ func EC2Ipam(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou } return values, nil } -func eC2IpamHandle(ctx context.Context, v types.Ipam) Resource { +func eC2IpamHandle(ctx context.Context, v types.Ipam) models.Resource { describeCtx := GetDescribeContext(ctx) - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.IpamArn, Name: *v.IpamId, @@ -3790,7 +3791,7 @@ func eC2IpamHandle(ctx context.Context, v types.Ipam) Resource { } return values } -func GetEC2Ipam(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2Ipam(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { IpamId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3801,7 +3802,7 @@ func GetEC2Ipam(ctx context.Context, cfg aws.Config, fields map[string]string) ( return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Ipams { resource := eC2IpamHandle(ctx, v) values = append(values, resource) @@ -3809,12 +3810,12 @@ func GetEC2Ipam(ctx context.Context, cfg aws.Config, fields map[string]string) ( return values, nil } -func EC2InstanceAvailability(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2InstanceAvailability(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeInstanceTypeOfferingsPaginator(client, &ec2.DescribeInstanceTypeOfferingsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -3823,7 +3824,7 @@ func EC2InstanceAvailability(ctx context.Context, cfg aws.Config, stream *Stream for _, v := range page.InstanceTypeOfferings { arn := fmt.Sprintf("arn:%s:ec2:%s::instance-type/%s", describeCtx.Partition, *v.Location, v.InstanceType) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: fmt.Sprintf("%s (%s)", v.InstanceType, *v.Location), @@ -3845,13 +3846,13 @@ func EC2InstanceAvailability(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func EC2InstanceType(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2InstanceType(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeInstanceTypesPaginator(client, &ec2.DescribeInstanceTypesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -3860,7 +3861,7 @@ func EC2InstanceType(ctx context.Context, cfg aws.Config, stream *StreamSender) for _, v := range page.InstanceTypes { arn := fmt.Sprintf("arn:%s:ec2:::instance-type/%s", describeCtx.Partition, v.InstanceType) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: string(v.InstanceType), @@ -3881,11 +3882,11 @@ func EC2InstanceType(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func EC2ManagedPrefixList(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2ManagedPrefixList(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeManagedPrefixListsPaginator(client, &ec2.DescribeManagedPrefixListsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -3906,9 +3907,9 @@ func EC2ManagedPrefixList(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func eC2ManagedPrefixListHandle(ctx context.Context, v types.ManagedPrefixList) Resource { +func eC2ManagedPrefixListHandle(ctx context.Context, v types.ManagedPrefixList) models.Resource { describeCtx := GetDescribeContext(ctx) - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.PrefixListArn, Name: *v.PrefixListName, @@ -3918,7 +3919,7 @@ func eC2ManagedPrefixListHandle(ctx context.Context, v types.ManagedPrefixList) } return values } -func GetEC2ManagedPrefixList(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2ManagedPrefixList(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { ManagedPrefixListId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -3929,7 +3930,7 @@ func GetEC2ManagedPrefixList(ctx context.Context, cfg aws.Config, fields map[str return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.PrefixLists { resource := eC2ManagedPrefixListHandle(ctx, v) values = append(values, resource) @@ -3937,7 +3938,7 @@ func GetEC2ManagedPrefixList(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func EC2SpotPrice(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2SpotPrice(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) @@ -3948,7 +3949,7 @@ func EC2SpotPrice(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] EndTime: &endTime, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -3963,7 +3964,7 @@ func EC2SpotPrice(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] if v.AvailabilityZone != nil { avZone = *v.AvailabilityZone } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: fmt.Sprintf("%s-%s (%s)", v.InstanceType, *v.SpotPrice, avZone), Description: model.EC2SpotPriceDescription{ @@ -3985,13 +3986,13 @@ func EC2SpotPrice(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] } // TODO mahan : check that this function implemented correctly -func EC2TransitGatewayRoute(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayRoute(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTransitGatewayRouteTablesPaginator(client, &ec2.DescribeTransitGatewayRouteTablesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4013,7 +4014,7 @@ func EC2TransitGatewayRoute(ctx context.Context, cfg aws.Config, stream *StreamS } for _, route := range routes.Routes { arn := fmt.Sprintf("arn:%s:ec2:%s:%s:transit-gateway-route-table/%s:%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *transitGatewayRouteTable.TransitGatewayRouteTableId, *route.DestinationCidrBlock) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *route.DestinationCidrBlock, @@ -4034,7 +4035,7 @@ func EC2TransitGatewayRoute(ctx context.Context, cfg aws.Config, stream *StreamS } return values, nil } -func GetEC2TransitGatewayRoute(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2TransitGatewayRoute(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) TransitGatewayRouteId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -4048,10 +4049,10 @@ func GetEC2TransitGatewayRoute(ctx context.Context, cfg aws.Config, fields map[s if len(routTable.TransitGatewayRouteTables) == 0 { return nil, nil } - var values []Resource + var values []models.Resource for _, v := range routTable.TransitGatewayRouteTables { arn := fmt.Sprintf("arn:%s:ec2:%s:%s:transit-gateway-route-table/%s:%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.TransitGatewayRouteTableId) - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.TransitGatewayRouteTableId, @@ -4063,11 +4064,11 @@ func GetEC2TransitGatewayRoute(ctx context.Context, cfg aws.Config, fields map[s return values, nil } -func EC2TransitGatewayAttachment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2TransitGatewayAttachment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeTransitGatewayAttachmentsPaginator(client, &ec2.DescribeTransitGatewayAttachmentsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4087,11 +4088,11 @@ func EC2TransitGatewayAttachment(ctx context.Context, cfg aws.Config, stream *St } return values, nil } -func eC2TransitGatewayAttachmentHandle(ctx context.Context, v types.TransitGatewayAttachment) Resource { - var values Resource +func eC2TransitGatewayAttachmentHandle(ctx context.Context, v types.TransitGatewayAttachment) models.Resource { + var values models.Resource describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:transit-gateway-attachment/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.TransitGatewayAttachmentId) - values = Resource{ + values = models.Resource{ Region: describeCtx.OGRegion, ID: *v.TransitGatewayAttachmentId, ARN: arn, @@ -4101,7 +4102,7 @@ func eC2TransitGatewayAttachmentHandle(ctx context.Context, v types.TransitGatew } return values } -func GetEC2TransitGatewayAttachment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2TransitGatewayAttachment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { TransitGatewayAttachmentId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -4112,7 +4113,7 @@ func GetEC2TransitGatewayAttachment(ctx context.Context, cfg aws.Config, fields return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.TransitGatewayAttachments { resource := eC2TransitGatewayAttachmentHandle(ctx, v) values = append(values, resource) @@ -4120,11 +4121,11 @@ func GetEC2TransitGatewayAttachment(ctx context.Context, cfg aws.Config, fields return values, nil } -func EC2LaunchTemplate(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2LaunchTemplate(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeLaunchTemplatesPaginator(client, &ec2.DescribeLaunchTemplatesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4144,10 +4145,10 @@ func EC2LaunchTemplate(ctx context.Context, cfg aws.Config, stream *StreamSender } return values, nil } -func eC2LaunchTemplateHandle(ctx context.Context, v types.LaunchTemplate) Resource { +func eC2LaunchTemplateHandle(ctx context.Context, v types.LaunchTemplate) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:ec2:%s:%s:launch-template/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.LaunchTemplateId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.LaunchTemplateId, ARN: arn, @@ -4159,7 +4160,7 @@ func eC2LaunchTemplateHandle(ctx context.Context, v types.LaunchTemplate) Resour return resource } -func GetEC2LaunchTemplate(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2LaunchTemplate(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { LaunchTemplateId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -4170,7 +4171,7 @@ func GetEC2LaunchTemplate(ctx context.Context, cfg aws.Config, fields map[string return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.LaunchTemplates { resource := eC2LaunchTemplateHandle(ctx, v) values = append(values, resource) @@ -4178,14 +4179,14 @@ func GetEC2LaunchTemplate(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func EbsVolumeMetricReadOps(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EbsVolumeMetricReadOps(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVolumesPaginator(client, &ec2.DescribeVolumesInput{ MaxResults: aws.Int32(500), }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4198,7 +4199,7 @@ func EbsVolumeMetricReadOps(ctx context.Context, cfg aws.Config, stream *StreamS return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s", *v.VolumeId, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.EbsVolumeMetricReadOpsDescription{ @@ -4220,14 +4221,14 @@ func EbsVolumeMetricReadOps(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func EbsVolumeMetricReadOpsDaily(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EbsVolumeMetricReadOpsDaily(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVolumesPaginator(client, &ec2.DescribeVolumesInput{ MaxResults: aws.Int32(500), }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4240,7 +4241,7 @@ func EbsVolumeMetricReadOpsDaily(ctx context.Context, cfg aws.Config, stream *St return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s-daily", *v.VolumeId, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.EbsVolumeMetricReadOpsDailyDescription{ @@ -4262,14 +4263,14 @@ func EbsVolumeMetricReadOpsDaily(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func EbsVolumeMetricReadOpsHourly(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EbsVolumeMetricReadOpsHourly(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVolumesPaginator(client, &ec2.DescribeVolumesInput{ MaxResults: aws.Int32(500), }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4282,7 +4283,7 @@ func EbsVolumeMetricReadOpsHourly(ctx context.Context, cfg aws.Config, stream *S return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s-hourly", *v.VolumeId, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.EbsVolumeMetricReadOpsHourlyDescription{ @@ -4304,14 +4305,14 @@ func EbsVolumeMetricReadOpsHourly(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func EbsVolumeMetricWriteOps(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EbsVolumeMetricWriteOps(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVolumesPaginator(client, &ec2.DescribeVolumesInput{ MaxResults: aws.Int32(500), }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4324,7 +4325,7 @@ func EbsVolumeMetricWriteOps(ctx context.Context, cfg aws.Config, stream *Stream return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s", *v.VolumeId, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.EbsVolumeMetricWriteOpsDescription{ @@ -4346,14 +4347,14 @@ func EbsVolumeMetricWriteOps(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func EbsVolumeMetricWriteOpsDaily(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EbsVolumeMetricWriteOpsDaily(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVolumesPaginator(client, &ec2.DescribeVolumesInput{ MaxResults: aws.Int32(500), }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4366,7 +4367,7 @@ func EbsVolumeMetricWriteOpsDaily(ctx context.Context, cfg aws.Config, stream *S return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s-daily", *v.VolumeId, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.EbsVolumeMetricWriteOpsDailyDescription{ @@ -4388,14 +4389,14 @@ func EbsVolumeMetricWriteOpsDaily(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func EbsVolumeMetricWriteOpsHourly(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EbsVolumeMetricWriteOpsHourly(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeVolumesPaginator(client, &ec2.DescribeVolumesInput{ MaxResults: aws.Int32(500), }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4408,7 +4409,7 @@ func EbsVolumeMetricWriteOpsHourly(ctx context.Context, cfg aws.Config, stream * return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s-hourly", *v.VolumeId, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.EbsVolumeMetricWriteOpsHourlyDescription{ @@ -4429,11 +4430,11 @@ func EbsVolumeMetricWriteOpsHourly(ctx context.Context, cfg aws.Config, stream * return values, nil } -func EC2VPCNatGatewayMetricBytesOutToDestination(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2VPCNatGatewayMetricBytesOutToDestination(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeNatGatewaysPaginator(client, &ec2.DescribeNatGatewaysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4452,9 +4453,9 @@ func EC2VPCNatGatewayMetricBytesOutToDestination(ctx context.Context, cfg aws.Co } return values, nil } -func eC2VPCNatGatewayMetricBytesOutToDestinationHandle(ctx context.Context, v types.NatGateway) Resource { +func eC2VPCNatGatewayMetricBytesOutToDestinationHandle(ctx context.Context, v types.NatGateway) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.NatGatewayId, Description: model.EC2NatGatewayMetricBytesOutToDestinationDescription{ @@ -4463,7 +4464,7 @@ func eC2VPCNatGatewayMetricBytesOutToDestinationHandle(ctx context.Context, v ty } return resource } -func GetEC2VPCNatGatewayMetricBytesOutToDestination(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2VPCNatGatewayMetricBytesOutToDestination(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { natGatewayId := fields["id"] client := ec2.NewFromConfig(cfg) natGateway, err := client.DescribeNatGateways(ctx, &ec2.DescribeNatGatewaysInput{ @@ -4476,7 +4477,7 @@ func GetEC2VPCNatGatewayMetricBytesOutToDestination(ctx context.Context, cfg aws return nil, err } - var values []Resource + var values []models.Resource for _, v := range natGateway.NatGateways { resource := eC2VPCNatGatewayMetricBytesOutToDestinationHandle(ctx, v) values = append(values, resource) @@ -4484,11 +4485,11 @@ func GetEC2VPCNatGatewayMetricBytesOutToDestination(ctx context.Context, cfg aws return values, nil } -func EC2LaunchTemplateVersion(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2LaunchTemplateVersion(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeLaunchTemplatesPaginator(client, &ec2.DescribeLaunchTemplatesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4517,9 +4518,9 @@ func EC2LaunchTemplateVersion(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func eC2LaunchTemplateVersionHandle(ctx context.Context, v types.LaunchTemplateVersion) Resource { +func eC2LaunchTemplateVersionHandle(ctx context.Context, v types.LaunchTemplateVersion) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.EC2LaunchTemplateVersionDescription{ LaunchTemplateVersion: v, @@ -4528,7 +4529,7 @@ func eC2LaunchTemplateVersionHandle(ctx context.Context, v types.LaunchTemplateV return resource } -func GetEC2LaunchTemplateVersion(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEC2LaunchTemplateVersion(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { LaunchTemplateId := fields["id"] client := ec2.NewFromConfig(cfg) @@ -4539,7 +4540,7 @@ func GetEC2LaunchTemplateVersion(ctx context.Context, cfg aws.Config, fields map return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.LaunchTemplateVersions { resource := eC2LaunchTemplateVersionHandle(ctx, v) values = append(values, resource) @@ -4547,11 +4548,11 @@ func GetEC2LaunchTemplateVersion(ctx context.Context, cfg aws.Config, fields map return values, nil } -func EC2ManagedPrefixListEntry(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EC2ManagedPrefixListEntry(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeManagedPrefixListsPaginator(client, &ec2.DescribeManagedPrefixListsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4583,9 +4584,9 @@ func EC2ManagedPrefixListEntry(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func eC2ManagedPrefixListEntryHandle(ctx context.Context, prefixListId string, v types.PrefixListEntry) Resource { +func eC2ManagedPrefixListEntryHandle(ctx context.Context, prefixListId string, v types.PrefixListEntry) models.Resource { describeCtx := GetDescribeContext(ctx) - values := Resource{ + values := models.Resource{ Region: describeCtx.OGRegion, Description: model.EC2ManagedPrefixListEntryDescription{ PrefixListEntry: v, @@ -4595,11 +4596,11 @@ func eC2ManagedPrefixListEntryHandle(ctx context.Context, prefixListId string, v return values } -func Ec2InstanceMetricCpuUtilizationHourly(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Ec2InstanceMetricCpuUtilizationHourly(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ec2.NewFromConfig(cfg) paginator := ec2.NewDescribeInstancesPaginator(client, &ec2.DescribeInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -4627,16 +4628,16 @@ func Ec2InstanceMetricCpuUtilizationHourly(ctx context.Context, cfg aws.Config, return values, nil } -func getEc2InstanceMetricCpuUtilizationHourly(ctx context.Context, cfg aws.Config, instanceId *string) ([]Resource, error) { +func getEc2InstanceMetricCpuUtilizationHourly(ctx context.Context, cfg aws.Config, instanceId *string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) statistics, err := listCloudWatchMetricStatistics(ctx, cfg, "HOURLY", "AWS/EC2", "CPUUtilization", "InstanceId", *instanceId) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, s := range statistics { - values = append(values, Resource{ + values = append(values, models.Resource{ Account: describeCtx.AccountID, Region: describeCtx.OGRegion, Description: model.EC2InstanceMetricCpuUtilizationHourlyDescription{ diff --git a/provider/describer/ecr.go b/provider/describer/ecr.go index 5f0a7724..b7eaf9af 100755 --- a/provider/describer/ecr.go +++ b/provider/describer/ecr.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -15,15 +16,15 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func ECRPublicRepository(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECRPublicRepository(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { // Only supported in US-EAST-1 if !strings.EqualFold(cfg.Region, "us-east-1") { - return []Resource{}, nil + return []models.Resource{}, nil } client := ecrpublic.NewFromConfig(cfg) paginator := ecrpublic.NewDescribeRepositoriesPaginator(client, &ecrpublic.DescribeRepositoriesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -50,7 +51,7 @@ func ECRPublicRepository(ctx context.Context, cfg aws.Config, stream *StreamSend } resource, err := eCRPublicRepositoryHandle(ctx, cfg, v, imageDetails) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -70,7 +71,7 @@ func ECRPublicRepository(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func eCRPublicRepositoryHandle(ctx context.Context, cfg aws.Config, v public_types.Repository, imageDetails []public_types.ImageDetail) (Resource, error) { +func eCRPublicRepositoryHandle(ctx context.Context, cfg aws.Config, v public_types.Repository, imageDetails []public_types.ImageDetail) (models.Resource, error) { client := ecrpublic.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) policyOutput, err := client.GetRepositoryPolicy(ctx, &ecrpublic.GetRepositoryPolicyInput{ @@ -78,7 +79,7 @@ func eCRPublicRepositoryHandle(ctx context.Context, cfg aws.Config, v public_typ }) if err != nil { if !isErr(err, "RepositoryNotFoundException") && !isErr(err, "RepositoryPolicyNotFoundException") && !isErr(err, "LifecyclePolicyNotFoundException") { - return Resource{}, err + return models.Resource{}, err } } @@ -87,13 +88,13 @@ func eCRPublicRepositoryHandle(ctx context.Context, cfg aws.Config, v public_typ }) if err != nil { if !isErr(err, "RepositoryNotFoundException") && !isErr(err, "RepositoryPolicyNotFoundException") && !isErr(err, "LifecyclePolicyNotFoundException") { - return Resource{}, err + return models.Resource{}, err } else { tagsOutput = &ecrpublic.ListTagsForResourceOutput{} } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.RepositoryArn, Name: *v.RepositoryName, @@ -106,7 +107,7 @@ func eCRPublicRepositoryHandle(ctx context.Context, cfg aws.Config, v public_typ } return resource, nil } -func GetECRPublicRepository(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetECRPublicRepository(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { repositoryName := fields["name"] client := ecrpublic.NewFromConfig(cfg) out, err := client.DescribeRepositories(ctx, &ecrpublic.DescribeRepositoriesInput{ @@ -119,7 +120,7 @@ func GetECRPublicRepository(ctx context.Context, cfg aws.Config, fields map[stri return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Repositories { var imageDetails []public_types.ImageDetail @@ -135,7 +136,7 @@ func GetECRPublicRepository(ctx context.Context, cfg aws.Config, fields map[stri imageDetails = append(imageDetails, images.ImageDetails...) resource, err := eCRPublicRepositoryHandle(ctx, cfg, v, imageDetails) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -148,16 +149,16 @@ func GetECRPublicRepository(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func ECRPublicRegistry(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECRPublicRegistry(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) // Only supported in US-EAST-1 if !strings.EqualFold(cfg.Region, "us-east-1") { - return []Resource{}, nil + return []models.Resource{}, nil } client := ecrpublic.NewFromConfig(cfg) paginator := ecrpublic.NewDescribeRegistriesPaginator(client, &ecrpublic.DescribeRegistriesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -173,7 +174,7 @@ func ECRPublicRegistry(ctx context.Context, cfg aws.Config, stream *StreamSender tags = tagsOutput.Tags } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.RegistryArn, Name: *v.RegistryId, @@ -195,11 +196,11 @@ func ECRPublicRegistry(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func ECRRepository(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECRRepository(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ecr.NewFromConfig(cfg) paginator := ecr.NewDescribeRepositoriesPaginator(client, &ecr.DescribeRepositoriesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -227,7 +228,7 @@ func ECRRepository(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func eCRRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Repository) (Resource, error) { +func eCRRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Repository) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ecr.NewFromConfig(cfg) lifeCyclePolicyOutput, err := client.GetLifecyclePolicy(ctx, &ecr.GetLifecyclePolicyInput{ @@ -235,7 +236,7 @@ func eCRRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Repository }) if err != nil { if !isErr(err, "RepositoryNotFoundException") && !isErr(err, "RepositoryPolicyNotFoundException") && !isErr(err, "LifecyclePolicyNotFoundException") || isErr(err, "AccessDeniedException") { - return Resource{}, err + return models.Resource{}, err } } @@ -249,7 +250,7 @@ func eCRRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Repository if isErr(err, "RepositoryNotFoundException") || isErr(err, "RepositoryPolicyNotFoundException") || isErr(err, "LifecyclePolicyNotFoundException") { continue } - return Resource{}, err + return models.Resource{}, err } imageDetails = append(imageDetails, imagePage.ImageDetails...) } @@ -260,7 +261,7 @@ func eCRRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Repository }) if err != nil { if !isErr(err, "RepositoryNotFoundException") && !isErr(err, "RepositoryPolicyNotFoundException") && !isErr(err, "LifecyclePolicyNotFoundException") { - return Resource{}, err + return models.Resource{}, err } } @@ -269,7 +270,7 @@ func eCRRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Repository }) if err != nil { if !isErr(err, "RepositoryNotFoundException") && !isErr(err, "RepositoryPolicyNotFoundException") && !isErr(err, "LifecyclePolicyNotFoundException") { - return Resource{}, err + return models.Resource{}, err } } @@ -278,13 +279,13 @@ func eCRRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Repository }) if err != nil { if !isErr(err, "RepositoryNotFoundException") && !isErr(err, "RepositoryPolicyNotFoundException") && !isErr(err, "LifecyclePolicyNotFoundException") { - return Resource{}, err + return models.Resource{}, err } else { tagsOutput = &ecr.ListTagsForResourceOutput{} } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.RepositoryArn, Name: *v.RepositoryName, @@ -299,7 +300,7 @@ func eCRRepositoryHandle(ctx context.Context, cfg aws.Config, v types.Repository } return resource, nil } -func GetECRRepository(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetECRRepository(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := ecr.NewFromConfig(cfg) repositoryName := fields["name"] out, err := client.DescribeRepositories(ctx, &ecr.DescribeRepositoriesInput{ @@ -309,7 +310,7 @@ func GetECRRepository(ctx context.Context, cfg aws.Config, fields map[string]str return nil, err } - var values []Resource + var values []models.Resource for _, repository := range out.Repositories { resource, err := eCRRepositoryHandle(ctx, cfg, repository) if err != nil { @@ -320,7 +321,7 @@ func GetECRRepository(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func ECRRegistryPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECRRegistryPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ecr.NewFromConfig(cfg) output, err := client.GetRegistryPolicy(ctx, &ecr.GetRegistryPolicyInput{}) @@ -328,13 +329,13 @@ func ECRRegistryPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender var ae smithy.APIError e := types.RegistryPolicyNotFoundException{} if errors.As(err, &ae) && ae.ErrorCode() == e.ErrorCode() { - return []Resource{}, nil + return []models.Resource{}, nil } return nil, err } - var values []Resource - resource := Resource{ + var values []models.Resource + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *output.RegistryId, Name: *output.RegistryId, @@ -351,7 +352,7 @@ func ECRRegistryPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func ECRRegistry(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECRRegistry(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ecr.NewFromConfig(cfg) output, err := client.DescribeRegistry(ctx, &ecr.DescribeRegistryInput{}) @@ -359,8 +360,8 @@ func ECRRegistry(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return nil, err } - var values []Resource - resource := Resource{ + var values []models.Resource + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *output.RegistryId, Name: *output.RegistryId, @@ -380,11 +381,11 @@ func ECRRegistry(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func ECRImage(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECRImage(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ecr.NewFromConfig(cfg) repositoryPaginator := ecr.NewDescribeRepositoriesPaginator(client, &ecr.DescribeRepositoriesInput{}) - var values []Resource + var values []models.Resource for repositoryPaginator.HasMorePages() { repositoryPage, err := repositoryPaginator.NextPage(ctx) if err != nil { @@ -426,7 +427,7 @@ func ECRImage(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func eCRImageHandle(ctx context.Context, cfg aws.Config, image types.ImageDetail, repository types.Repository) (Resource, error) { +func eCRImageHandle(ctx context.Context, cfg aws.Config, image types.ImageDetail, repository types.Repository) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) var uri string if len(image.ImageTags) == 0 { @@ -435,7 +436,7 @@ func eCRImageHandle(ctx context.Context, cfg aws.Config, image types.ImageDetail uri = describeCtx.AccountID + ".dkr.ecr." + describeCtx.Region + ".amazonaws.com/" + *image.RepositoryName + ":" + image.ImageTags[0] } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: fmt.Sprintf("%s:%s", *repository.RepositoryArn, *image.ImageDigest), Description: model.ECRImageDescription{ @@ -445,7 +446,7 @@ func eCRImageHandle(ctx context.Context, cfg aws.Config, image types.ImageDetail } return resource, nil } -func GetECRImage(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetECRImage(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { repositoryName := fields["repositoryName"] client := ecr.NewFromConfig(cfg) @@ -459,7 +460,7 @@ func GetECRImage(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, err } - var values []Resource + var values []models.Resource for _, repository := range out.Repositories { images, err := client.DescribeImages(ctx, &ecr.DescribeImagesInput{ RepositoryName: repository.RepositoryName, @@ -483,7 +484,7 @@ func GetECRImage(ctx context.Context, cfg aws.Config, fields map[string]string) return values, nil } -func ECRRegistryScanningConfiguration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECRRegistryScanningConfiguration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ecr.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) @@ -491,9 +492,9 @@ func ECRRegistryScanningConfiguration(ctx context.Context, cfg aws.Config, strea if err != nil { return nil, err } - var values []Resource + var values []models.Resource - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *scanningConfiguration.RegistryId, Name: *scanningConfiguration.RegistryId, diff --git a/provider/describer/ecs.go b/provider/describer/ecs.go index e4d640a3..d2d0314c 100755 --- a/provider/describer/ecs.go +++ b/provider/describer/ecs.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -12,11 +13,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func ECSCapacityProvider(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECSCapacityProvider(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ecs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeCapacityProviders(ctx, &ecs.DescribeCapacityProvidersInput{NextToken: prevToken}) if err != nil { @@ -27,7 +28,7 @@ func ECSCapacityProvider(ctx context.Context, cfg aws.Config, stream *StreamSend } for _, v := range output.CapacityProviders { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.CapacityProviderArn, Name: *v.Name, @@ -51,7 +52,7 @@ func ECSCapacityProvider(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func ECSCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECSCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { clusters, err := listEcsClusters(ctx, cfg, nil) if err != nil { return nil, err @@ -59,7 +60,7 @@ func ECSCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re client := ecs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource // Describe in batch of 100 which is the limit for i := 0; i < len(clusters); i = i + 100 { j := i + 100 @@ -91,9 +92,9 @@ func ECSCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func eCSClusterHandle(ctx context.Context, v types.Cluster) Resource { +func eCSClusterHandle(ctx context.Context, v types.Cluster) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ClusterArn, Name: *v.ClusterName, @@ -103,12 +104,12 @@ func eCSClusterHandle(ctx context.Context, v types.Cluster) Resource { } return resource } -func GetECSCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetECSCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := ecs.NewFromConfig(cfg) cluster := fields["name"] - var values []Resource + var values []models.Resource output, err := client.DescribeClusters(ctx, &ecs.DescribeClustersInput{ Clusters: []string{cluster}, }) @@ -126,7 +127,7 @@ func GetECSCluster(ctx context.Context, cfg aws.Config, fields map[string]string return values, nil } -func ECSService(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECSService(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { clusters, err := listEcsClusters(ctx, cfg, nil) if err != nil { return nil, err @@ -134,7 +135,7 @@ func ECSService(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re client := ecs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, cluster := range clusters { // This prevents Implicit memory aliasing in for loop cluster := cluster @@ -179,17 +180,17 @@ func ECSService(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func eCSServiceHandle(ctx context.Context, v types.Service, client *ecs.Client) (Resource, error) { +func eCSServiceHandle(ctx context.Context, v types.Service, client *ecs.Client) (models.Resource, error) { params := &ecs.ListTagsForResourceInput{ ResourceArn: v.ServiceArn, } response, err := client.ListTagsForResource(ctx, params) if err != nil { - return Resource{}, err + return models.Resource{}, err } describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ServiceArn, Name: *v.ServiceName, @@ -200,12 +201,12 @@ func eCSServiceHandle(ctx context.Context, v types.Service, client *ecs.Client) } return resource, err } -func GetECSService(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetECSService(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { cluster := fields["cluster"] service := fields["service"] client := ecs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource output, err := client.DescribeServices(ctx, &ecs.DescribeServicesInput{ Cluster: &cluster, Services: []string{service}, @@ -228,11 +229,11 @@ func GetECSService(ctx context.Context, cfg aws.Config, fields map[string]string return values, nil } -func ECSTaskDefinition(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECSTaskDefinition(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ecs.NewFromConfig(cfg) paginator := ecs.NewListTaskDefinitionsPaginator(client, &ecs.ListTaskDefinitionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -245,7 +246,7 @@ func ECSTaskDefinition(ctx context.Context, cfg aws.Config, stream *StreamSender if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -262,7 +263,7 @@ func ECSTaskDefinition(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func eCSTaskDefinitionHandle(ctx context.Context, cfg aws.Config, arn string) (Resource, error) { +func eCSTaskDefinitionHandle(ctx context.Context, cfg aws.Config, arn string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ecs.NewFromConfig(cfg) @@ -274,16 +275,16 @@ func eCSTaskDefinitionHandle(ctx context.Context, cfg aws.Config, arn string) (R }) if err != nil { if isErr(err, "DescribeTaskDefinitionNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } // From Steampipe splitArn := strings.Split(arn, ":") name := splitArn[len(splitArn)-1] - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: name, @@ -294,15 +295,15 @@ func eCSTaskDefinitionHandle(ctx context.Context, cfg aws.Config, arn string) (R } return resource, nil } -func GetECSTaskDefinition(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetECSTaskDefinition(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { taskDefinitionARN := fields["arn"] - var values []Resource + var values []models.Resource resource, err := eCSTaskDefinitionHandle(ctx, cfg, taskDefinitionARN) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -310,14 +311,14 @@ func GetECSTaskDefinition(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func ECSTaskSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECSTaskSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { clusters, err := listEcsClusters(ctx, cfg, nil) if err != nil { return nil, err } client := ecs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, cluster := range clusters { cluster := cluster @@ -365,9 +366,9 @@ func ECSTaskSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func eCSTaskSetHandle(ctx context.Context, v types.TaskSet) Resource { +func eCSTaskSetHandle(ctx context.Context, v types.TaskSet) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TaskSetArn, Name: *v.Id, @@ -377,7 +378,7 @@ func eCSTaskSetHandle(ctx context.Context, v types.TaskSet) Resource { } return resource } -func GetECSTaskSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetECSTaskSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { cluster := fields["cluster"] service := fields["service"] client := ecs.NewFromConfig(cfg) @@ -393,7 +394,7 @@ func GetECSTaskSet(ctx context.Context, cfg aws.Config, fields map[string]string return nil, err } - var values []Resource + var values []models.Resource for _, v := range taskSets.TaskSets { resource := eCSTaskSetHandle(ctx, v) values = append(values, resource) @@ -420,7 +421,7 @@ func listECsServices(ctx context.Context, cfg aws.Config, cluster string) ([]str return services, nil } -func listEcsClusters(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]string, error) { +func listEcsClusters(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]string, error) { client := ecs.NewFromConfig(cfg) paginator := ecs.NewListClustersPaginator(client, &ecs.ListClustersInput{}) @@ -437,7 +438,7 @@ func listEcsClusters(ctx context.Context, cfg aws.Config, stream *StreamSender) return clusters, nil } -func ECSContainerInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECSContainerInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) clusters, err := listEcsClusters(ctx, cfg, nil) if err != nil { @@ -446,7 +447,7 @@ func ECSContainerInstance(ctx context.Context, cfg aws.Config, stream *StreamSen client := ecs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, cluster := range clusters { paginator := ecs.NewListContainerInstancesPaginator(client, &ecs.ListContainerInstancesInput{ Cluster: &cluster, @@ -483,7 +484,7 @@ func ECSContainerInstance(ctx context.Context, cfg aws.Config, stream *StreamSen for _, v := range output.ContainerInstances { for _, c := range describeCluster.Clusters { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ContainerInstanceArn, Name: *v.ContainerInstanceArn, @@ -508,7 +509,7 @@ func ECSContainerInstance(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func ECSTask(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ECSTask(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) clusters, err := listEcsClusters(ctx, cfg, nil) if err != nil { @@ -516,7 +517,7 @@ func ECSTask(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou } client := ecs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, cluster := range clusters { cluster := cluster @@ -575,7 +576,7 @@ func ECSTask(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou if taskProtection, ok := taskProtectionMap[*v.TaskArn]; ok { description.TaskProtection = &taskProtection } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TaskArn, Name: *v.TaskArn, diff --git a/provider/describer/efs.go b/provider/describer/efs.go index 9dd5d709..f523004f 100755 --- a/provider/describer/efs.go +++ b/provider/describer/efs.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/service/efs/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/efs" @@ -15,10 +16,10 @@ const ( efsPolicyNotFound = "PolicyNotFound" ) -func EFSAccessPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EFSAccessPoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := efs.NewFromConfig(cfg) paginator := efs.NewDescribeAccessPointsPaginator(client, &efs.DescribeAccessPointsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -38,14 +39,14 @@ func EFSAccessPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } return values, nil } -func eFSAccessPointHandle(ctx context.Context, v types.AccessPointDescription) Resource { +func eFSAccessPointHandle(ctx context.Context, v types.AccessPointDescription) models.Resource { describeCtx := GetDescribeContext(ctx) name := aws.ToString(v.Name) if name == "" { name = *v.AccessPointId } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AccessPointArn, Name: name, @@ -55,7 +56,7 @@ func eFSAccessPointHandle(ctx context.Context, v types.AccessPointDescription) R } return resource } -func GetEFSAccessPoint(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEFSAccessPoint(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { accessPointId := fields["id"] client := efs.NewFromConfig(cfg) out, err := client.DescribeAccessPoints(ctx, &efs.DescribeAccessPointsInput{ @@ -68,7 +69,7 @@ func GetEFSAccessPoint(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.AccessPoints { resource := eFSAccessPointHandle(ctx, v) values = append(values, resource) @@ -76,11 +77,11 @@ func GetEFSAccessPoint(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func EFSFileSystem(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EFSFileSystem(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := efs.NewFromConfig(cfg) paginator := efs.NewDescribeFileSystemsPaginator(client, &efs.DescribeFileSystemsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -114,14 +115,14 @@ func EFSFileSystem(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func eFSFileSystemHandle(ctx context.Context, describeFSPolicy *efs.DescribeFileSystemPolicyOutput, v types.FileSystemDescription) Resource { +func eFSFileSystemHandle(ctx context.Context, describeFSPolicy *efs.DescribeFileSystemPolicyOutput, v types.FileSystemDescription) models.Resource { describeCtx := GetDescribeContext(ctx) name := aws.ToString(v.Name) if name == "" { name = *v.FileSystemId } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.FileSystemArn, Name: name, @@ -132,10 +133,10 @@ func eFSFileSystemHandle(ctx context.Context, describeFSPolicy *efs.DescribeFile } return resource } -func GetEFSFileSystem(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetEFSFileSystem(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { fileSystemId := field["id"] client := efs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource describeFSPolicy, err := client.DescribeFileSystemPolicy(ctx, &efs.DescribeFileSystemPolicyInput{ FileSystemId: &fileSystemId, }) @@ -164,10 +165,10 @@ func GetEFSFileSystem(ctx context.Context, cfg aws.Config, field map[string]stri return values, nil } -func EFSMountTarget(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EFSMountTarget(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := efs.NewFromConfig(cfg) - var values []Resource + var values []models.Resource filesystems, err := EFSFileSystem(ctx, cfg, nil) if err != nil { @@ -210,11 +211,11 @@ func EFSMountTarget(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func eFSMountTargetHandle(ctx context.Context, securityGroups *efs.DescribeMountTargetSecurityGroupsOutput, v types.MountTargetDescription, FileSystemId *string) Resource { +func eFSMountTargetHandle(ctx context.Context, securityGroups *efs.DescribeMountTargetSecurityGroupsOutput, v types.MountTargetDescription, FileSystemId *string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:elasticfilesystem:%s:%s:file-system/%s/mount-target/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *FileSystemId, *v.MountTargetId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *v.MountTargetId, @@ -225,9 +226,9 @@ func eFSMountTargetHandle(ctx context.Context, securityGroups *efs.DescribeMount } return resource } -func GetEFSMountTarget(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEFSMountTarget(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { fileSystemId := fields["id"] - var values []Resource + var values []models.Resource client := efs.NewFromConfig(cfg) out, err := client.DescribeMountTargets(ctx, &efs.DescribeMountTargetsInput{ diff --git a/provider/describer/eks.go b/provider/describer/eks.go index 2eb28016..4c71d97d 100755 --- a/provider/describer/eks.go +++ b/provider/describer/eks.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -34,18 +35,18 @@ type EKSIdentityProviderConfigDescription struct { IdentityProviderConfig types.OidcIdentityProviderConfig } -func EKSCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EKSCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { clusters, err := listEksClusters(ctx, cfg) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range clusters { // This prevents Implicit memory aliasing in for loop cluster := cluster resource, err := eKSClusterHandle(ctx, cfg, cluster) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -64,19 +65,19 @@ func EKSCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func eKSClusterHandle(ctx context.Context, cfg aws.Config, cluster string) (Resource, error) { +func eKSClusterHandle(ctx context.Context, cfg aws.Config, cluster string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := eks.NewFromConfig(cfg) output, err := client.DescribeCluster(ctx, &eks.DescribeClusterInput{Name: aws.String(cluster)}) if err != nil { if isErr(err, "DescribeClusterNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *output.Cluster.Arn, Name: *output.Cluster.Name, @@ -86,13 +87,13 @@ func eKSClusterHandle(ctx context.Context, cfg aws.Config, cluster string) (Reso } return resource, nil } -func GetEKSCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEKSCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterName := fields["name"] clusters, err := listEksClusters(ctx, cfg) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range clusters { cluster := cluster if !strings.EqualFold(*aws.String(cluster), clusterName) { @@ -100,7 +101,7 @@ func GetEKSCluster(ctx context.Context, cfg aws.Config, fields map[string]string } resource, err := eKSClusterHandle(ctx, cfg, cluster) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -113,7 +114,7 @@ func GetEKSCluster(ctx context.Context, cfg aws.Config, fields map[string]string return values, nil } -func EKSAddon(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EKSAddon(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { clusters, err := listEksClusters(ctx, cfg) if err != nil { return nil, err @@ -121,7 +122,7 @@ func EKSAddon(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso client := eks.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, cluster := range clusters { var addons []string @@ -137,7 +138,7 @@ func EKSAddon(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso for _, addon := range addons { resource, err := eKSAddonHandle(ctx, cfg, addon, cluster) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -157,7 +158,7 @@ func EKSAddon(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func eKSAddonHandle(ctx context.Context, cfg aws.Config, addon string, clusterName string) (Resource, error) { +func eKSAddonHandle(ctx context.Context, cfg aws.Config, addon string, clusterName string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := eks.NewFromConfig(cfg) @@ -167,12 +168,12 @@ func eKSAddonHandle(ctx context.Context, cfg aws.Config, addon string, clusterNa }) if err != nil { if isErr(err, "DescribeAddonNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *output.Addon.AddonArn, Name: *output.Addon.AddonName, @@ -182,7 +183,7 @@ func eKSAddonHandle(ctx context.Context, cfg aws.Config, addon string, clusterNa } return resource, nil } -func GetEKSAddon(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEKSAddon(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterName := fields["clusterName"] client := eks.NewFromConfig(cfg) addons, err := client.ListAddons(ctx, &eks.ListAddonsInput{ @@ -195,10 +196,10 @@ func GetEKSAddon(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, err } - var values []Resource + var values []models.Resource for _, addon := range addons.Addons { resource, err := eKSAddonHandle(ctx, cfg, addon, clusterName) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -211,7 +212,7 @@ func GetEKSAddon(ctx context.Context, cfg aws.Config, fields map[string]string) return values, nil } -func EKSFargateProfile(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EKSFargateProfile(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { clusters, err := listEksClusters(ctx, cfg) if err != nil { return nil, err @@ -219,7 +220,7 @@ func EKSFargateProfile(ctx context.Context, cfg aws.Config, stream *StreamSender client := eks.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, cluster := range clusters { var profiles []string @@ -234,7 +235,7 @@ func EKSFargateProfile(ctx context.Context, cfg aws.Config, stream *StreamSender for _, profile := range profiles { resource, err := eKSFargateProfileHandle(ctx, cfg, profile, cluster) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -254,7 +255,7 @@ func EKSFargateProfile(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func eKSFargateProfileHandle(ctx context.Context, cfg aws.Config, profile string, clusterName string) (Resource, error) { +func eKSFargateProfileHandle(ctx context.Context, cfg aws.Config, profile string, clusterName string) (models.Resource, error) { client := eks.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) output, err := client.DescribeFargateProfile(ctx, &eks.DescribeFargateProfileInput{ @@ -263,12 +264,12 @@ func eKSFargateProfileHandle(ctx context.Context, cfg aws.Config, profile string }) if err != nil { if isErr(err, "DescribeFargateProfileNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *output.FargateProfile.FargateProfileArn, Name: *output.FargateProfile.FargateProfileName, @@ -278,7 +279,7 @@ func eKSFargateProfileHandle(ctx context.Context, cfg aws.Config, profile string } return resource, nil } -func GetEKSFargateProfile(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEKSFargateProfile(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterName := fields["name"] client := eks.NewFromConfig(cfg) @@ -292,11 +293,11 @@ func GetEKSFargateProfile(ctx context.Context, cfg aws.Config, fields map[string return nil, err } - var values []Resource + var values []models.Resource for _, profile := range profiles.FargateProfileNames { resource, err := eKSFargateProfileHandle(ctx, cfg, profile, clusterName) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -309,7 +310,7 @@ func GetEKSFargateProfile(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func EKSNodegroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EKSNodegroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { clusters, err := listEksClusters(ctx, cfg) if err != nil { return nil, err @@ -317,7 +318,7 @@ func EKSNodegroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] client := eks.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, cluster := range clusters { cluster := cluster var groups []string @@ -335,7 +336,7 @@ func EKSNodegroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] for _, profile := range groups { resource, err := eKSNodegroupHandle(ctx, cfg, profile, cluster) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -355,7 +356,7 @@ func EKSNodegroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func eKSNodegroupHandle(ctx context.Context, cfg aws.Config, profile string, clusterName string) (Resource, error) { +func eKSNodegroupHandle(ctx context.Context, cfg aws.Config, profile string, clusterName string) (models.Resource, error) { client := eks.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) @@ -365,12 +366,12 @@ func eKSNodegroupHandle(ctx context.Context, cfg aws.Config, profile string, clu }) if err != nil { if isErr(err, "DescribeNodegroupNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *output.Nodegroup.NodegroupArn, Name: *output.Nodegroup.NodegroupName, @@ -380,7 +381,7 @@ func eKSNodegroupHandle(ctx context.Context, cfg aws.Config, profile string, clu } return resource, nil } -func GetEKSNodegroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEKSNodegroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterName := fields["name"] client := eks.NewFromConfig(cfg) @@ -394,10 +395,10 @@ func GetEKSNodegroup(ctx context.Context, cfg aws.Config, fields map[string]stri return nil, err } - var values []Resource + var values []models.Resource for _, profile := range groups.Nodegroups { resource, err := eKSNodegroupHandle(ctx, cfg, profile, clusterName) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -410,14 +411,14 @@ func GetEKSNodegroup(ctx context.Context, cfg aws.Config, fields map[string]stri return values, nil } -func EKSIdentityProviderConfig(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EKSIdentityProviderConfig(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) clusters, err := listEksClusters(ctx, cfg) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range clusters { cluster := cluster client := eks.NewFromConfig(cfg) @@ -441,7 +442,7 @@ func EKSIdentityProviderConfig(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *output.IdentityProviderConfig.Oidc.IdentityProviderConfigArn, Name: *config.Name, @@ -466,13 +467,13 @@ func EKSIdentityProviderConfig(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func EKSAddonVersion(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EKSAddonVersion(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := eks.NewFromConfig(cfg) paginator := eks.NewDescribeAddonVersionsPaginator(client, &eks.DescribeAddonVersionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -491,7 +492,7 @@ func EKSAddonVersion(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Description: model.EKSAddonVersionDescription{ diff --git a/provider/describer/elasticache.go b/provider/describer/elasticache.go index ce8cdeb2..80f612b3 100755 --- a/provider/describer/elasticache.go +++ b/provider/describer/elasticache.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/elasticache" @@ -9,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func ElastiCacheReplicationGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElastiCacheReplicationGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticache.NewFromConfig(cfg) paginator := elasticache.NewDescribeReplicationGroupsPaginator(client, &elasticache.DescribeReplicationGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -33,9 +34,9 @@ func ElastiCacheReplicationGroup(ctx context.Context, cfg aws.Config, stream *St } return values, nil } -func elastiCacheReplicationGroupHandle(ctx context.Context, item types.ReplicationGroup) Resource { +func elastiCacheReplicationGroupHandle(ctx context.Context, item types.ReplicationGroup) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ARN, Name: *item.ARN, @@ -45,7 +46,7 @@ func elastiCacheReplicationGroupHandle(ctx context.Context, item types.Replicati } return resource } -func GetElastiCacheReplicationGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElastiCacheReplicationGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { CacheReplicationId := fields["CacheReplicationId"] client := elasticache.NewFromConfig(cfg) out, err := client.DescribeReplicationGroups(ctx, &elasticache.DescribeReplicationGroupsInput{ @@ -58,18 +59,18 @@ func GetElastiCacheReplicationGroup(ctx context.Context, cfg aws.Config, fields return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.ReplicationGroups { values = append(values, elastiCacheReplicationGroupHandle(ctx, v)) } return values, nil } -func ElastiCacheCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElastiCacheCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticache.NewFromConfig(cfg) paginator := elasticache.NewDescribeCacheClustersPaginator(client, &elasticache.DescribeCacheClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -95,7 +96,7 @@ func ElastiCacheCluster(ctx context.Context, cfg aws.Config, stream *StreamSende } return values, nil } -func elastiCacheClusterHandle(ctx context.Context, cluster types.CacheCluster, client *elasticache.Client) (Resource, error) { +func elastiCacheClusterHandle(ctx context.Context, cluster types.CacheCluster, client *elasticache.Client) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) tagsOutput, err := client.ListTagsForResource(ctx, &elasticache.ListTagsForResourceInput{ @@ -103,13 +104,13 @@ func elastiCacheClusterHandle(ctx context.Context, cluster types.CacheCluster, c }) if err != nil { if !isErr(err, "CacheClusterNotFound") && !isErr(err, "InvalidParameterValue") { - return Resource{}, err + return models.Resource{}, err } else { tagsOutput = &elasticache.ListTagsForResourceOutput{} } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *cluster.ARN, Name: *cluster.ARN, @@ -120,7 +121,7 @@ func elastiCacheClusterHandle(ctx context.Context, cluster types.CacheCluster, c } return resource, nil } -func GetElastiCacheCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElastiCacheCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterID := fields["id"] client := elasticache.NewFromConfig(cfg) out, err := client.DescribeCacheClusters(ctx, &elasticache.DescribeCacheClustersInput{ @@ -133,7 +134,7 @@ func GetElastiCacheCluster(ctx context.Context, cfg aws.Config, fields map[strin return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range out.CacheClusters { resource, err := elastiCacheClusterHandle(ctx, cluster, client) if err != nil { @@ -144,11 +145,11 @@ func GetElastiCacheCluster(ctx context.Context, cfg aws.Config, fields map[strin return values, nil } -func ElastiCacheParameterGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElastiCacheParameterGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticache.NewFromConfig(cfg) paginator := elasticache.NewDescribeCacheParameterGroupsPaginator(client, &elasticache.DescribeCacheParameterGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -169,9 +170,9 @@ func ElastiCacheParameterGroup(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func elastiCacheParameterGroupHandle(ctx context.Context, cacheParameterGroup types.CacheParameterGroup) Resource { +func elastiCacheParameterGroupHandle(ctx context.Context, cacheParameterGroup types.CacheParameterGroup) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *cacheParameterGroup.ARN, Name: *cacheParameterGroup.CacheParameterGroupName, @@ -181,9 +182,9 @@ func elastiCacheParameterGroupHandle(ctx context.Context, cacheParameterGroup ty } return resource } -func GetElastiCacheParameterGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElastiCacheParameterGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { cacheParameterGroupName := fields["name"] - var values []Resource + var values []models.Resource client := elasticache.NewFromConfig(cfg) out, err := client.DescribeCacheParameterGroups(ctx, &elasticache.DescribeCacheParameterGroupsInput{ @@ -199,11 +200,11 @@ func GetElastiCacheParameterGroup(ctx context.Context, cfg aws.Config, fields ma return values, nil } -func ElastiCacheReservedCacheNode(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElastiCacheReservedCacheNode(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticache.NewFromConfig(cfg) paginator := elasticache.NewDescribeReservedCacheNodesPaginator(client, &elasticache.DescribeReservedCacheNodesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -224,9 +225,9 @@ func ElastiCacheReservedCacheNode(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func elastiCacheReservedCacheNodeHandle(ctx context.Context, reservedCacheNode types.ReservedCacheNode) Resource { +func elastiCacheReservedCacheNodeHandle(ctx context.Context, reservedCacheNode types.ReservedCacheNode) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *reservedCacheNode.ReservationARN, ID: *reservedCacheNode.ReservedCacheNodeId, @@ -236,7 +237,7 @@ func elastiCacheReservedCacheNodeHandle(ctx context.Context, reservedCacheNode t } return resource } -func GetElastiCacheReservedCacheNode(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElastiCacheReservedCacheNode(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] client := elasticache.NewFromConfig(cfg) out, err := client.DescribeReservedCacheNodes(ctx, &elasticache.DescribeReservedCacheNodesInput{ @@ -249,7 +250,7 @@ func GetElastiCacheReservedCacheNode(ctx context.Context, cfg aws.Config, fields return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.ReservedCacheNodes { resource := elastiCacheReservedCacheNodeHandle(ctx, v) values = append(values, resource) @@ -257,11 +258,11 @@ func GetElastiCacheReservedCacheNode(ctx context.Context, cfg aws.Config, fields return values, nil } -func ElastiCacheSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElastiCacheSubnetGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticache.NewFromConfig(cfg) paginator := elasticache.NewDescribeCacheSubnetGroupsPaginator(client, &elasticache.DescribeCacheSubnetGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -282,9 +283,9 @@ func ElastiCacheSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func elastiCacheSubnetGroupHandle(ctx context.Context, cacheSubnetGroup types.CacheSubnetGroup) Resource { +func elastiCacheSubnetGroupHandle(ctx context.Context, cacheSubnetGroup types.CacheSubnetGroup) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *cacheSubnetGroup.ARN, Name: *cacheSubnetGroup.CacheSubnetGroupName, @@ -294,7 +295,7 @@ func elastiCacheSubnetGroupHandle(ctx context.Context, cacheSubnetGroup types.Ca } return resource } -func GetElastiCacheSubnetGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElastiCacheSubnetGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { cacheSubnetGroupsName := fields["name"] client := elasticache.NewFromConfig(cfg) @@ -308,7 +309,7 @@ func GetElastiCacheSubnetGroup(ctx context.Context, cfg aws.Config, fields map[s return nil, err } - var values []Resource + var values []models.Resource for _, cacheSubnetGroup := range out.CacheSubnetGroups { resource := elastiCacheSubnetGroupHandle(ctx, cacheSubnetGroup) diff --git a/provider/describer/elasticbeanstalk.go b/provider/describer/elasticbeanstalk.go index 3cdf3eed..6e24b737 100755 --- a/provider/describer/elasticbeanstalk.go +++ b/provider/describer/elasticbeanstalk.go @@ -5,13 +5,14 @@ import ( "strings" "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk" "github.com/opengovern/og-describer-aws/provider/model" ) -func ElasticBeanstalkEnvironment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticBeanstalkEnvironment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticbeanstalk.NewFromConfig(cfg) out, err := client.DescribeEnvironments(ctx, &elasticbeanstalk.DescribeEnvironmentsInput{}) @@ -19,11 +20,11 @@ func ElasticBeanstalkEnvironment(ctx context.Context, cfg aws.Config, stream *St return nil, err } - var values []Resource + var values []models.Resource for _, item := range out.Environments { resource, err := elasticBeanstalkEnvironmentHandle(ctx, cfg, item) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -42,7 +43,7 @@ func ElasticBeanstalkEnvironment(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func elasticBeanstalkEnvironmentHandle(ctx context.Context, cfg aws.Config, item types.EnvironmentDescription) (Resource, error) { +func elasticBeanstalkEnvironmentHandle(ctx context.Context, cfg aws.Config, item types.EnvironmentDescription) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticbeanstalk.NewFromConfig(cfg) @@ -52,9 +53,9 @@ func elasticBeanstalkEnvironmentHandle(ctx context.Context, cfg aws.Config, item }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } managedActions, err := client.DescribeEnvironmentManagedActions(ctx, &elasticbeanstalk.DescribeEnvironmentManagedActionsInput{ @@ -63,9 +64,9 @@ func elasticBeanstalkEnvironmentHandle(ctx context.Context, cfg aws.Config, item }) if err != nil { if isErr(err, "DescribeEnvironmentManagedActionsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } params := &elasticbeanstalk.DescribeConfigurationSettingsInput{ @@ -77,15 +78,15 @@ func elasticBeanstalkEnvironmentHandle(ctx context.Context, cfg aws.Config, item configurationSettings, err := client.DescribeConfigurationSettings(ctx, params) if err != nil { if isErr(err, "DescribeConfigurationSettingsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } if configurationSettings != nil && len(configurationSettings.ConfigurationSettings) > 0 { configurationSettingsDescription = configurationSettings.ConfigurationSettings } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.EnvironmentArn, Name: *item.EnvironmentName, @@ -98,7 +99,7 @@ func elasticBeanstalkEnvironmentHandle(ctx context.Context, cfg aws.Config, item } return resource, nil } -func GetElasticBeanstalkEnvironment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElasticBeanstalkEnvironment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := elasticbeanstalk.NewFromConfig(cfg) environmentName := fields["name"] @@ -113,11 +114,11 @@ func GetElasticBeanstalkEnvironment(ctx context.Context, cfg aws.Config, fields return nil, err } - var values []Resource + var values []models.Resource for _, item := range out.Environments { resource, err := elasticBeanstalkEnvironmentHandle(ctx, cfg, item) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -130,7 +131,7 @@ func GetElasticBeanstalkEnvironment(ctx context.Context, cfg aws.Config, fields return values, nil } -func ElasticBeanstalkApplication(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticBeanstalkApplication(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticbeanstalk.NewFromConfig(cfg) out, err := client.DescribeApplications(ctx, &elasticbeanstalk.DescribeApplicationsInput{}) if err != nil { @@ -140,7 +141,7 @@ func ElasticBeanstalkApplication(ctx context.Context, cfg aws.Config, stream *St return nil, nil } - var values []Resource + var values []models.Resource for _, item := range out.Applications { resource, err := elasticBeanstalkApplicationHandle(ctx, cfg, item) if err != nil { @@ -158,7 +159,7 @@ func ElasticBeanstalkApplication(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func elasticBeanstalkApplicationHandle(ctx context.Context, cfg aws.Config, item types.ApplicationDescription) (Resource, error) { +func elasticBeanstalkApplicationHandle(ctx context.Context, cfg aws.Config, item types.ApplicationDescription) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticbeanstalk.NewFromConfig(cfg) @@ -168,12 +169,12 @@ func elasticBeanstalkApplicationHandle(ctx context.Context, cfg aws.Config, item }) if err != nil { if !isErr(err, "ResourceNotFoundException") && !isErr(err, "InsufficientPrivilegesException") { - return Resource{}, err + return models.Resource{}, err } tags = &elasticbeanstalk.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ApplicationArn, Name: *item.ApplicationName, @@ -185,7 +186,7 @@ func elasticBeanstalkApplicationHandle(ctx context.Context, cfg aws.Config, item return resource, nil } -func GetElasticBeanstalkApplication(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElasticBeanstalkApplication(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { applicationName := fields["name"] client := elasticbeanstalk.NewFromConfig(cfg) @@ -200,7 +201,7 @@ func GetElasticBeanstalkApplication(ctx context.Context, cfg aws.Config, fields return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Applications { resource, err := elasticBeanstalkApplicationHandle(ctx, cfg, v) if err != nil { @@ -212,12 +213,12 @@ func GetElasticBeanstalkApplication(ctx context.Context, cfg aws.Config, fields return values, nil } -func ElasticBeanstalkPlatform(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticBeanstalkPlatform(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticbeanstalk.NewFromConfig(cfg) paginator := elasticbeanstalk.NewListPlatformVersionsPaginator(client, &elasticbeanstalk.ListPlatformVersionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -232,7 +233,7 @@ func ElasticBeanstalkPlatform(ctx context.Context, cfg aws.Config, stream *Strea return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *platform.PlatformDescription.PlatformArn, Name: *platform.PlatformDescription.PlatformName, @@ -253,7 +254,7 @@ func ElasticBeanstalkPlatform(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func ElasticBeanstalkApplicationVersion(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticBeanstalkApplicationVersion(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticbeanstalk.NewFromConfig(cfg) pagesLeft := true @@ -265,7 +266,7 @@ func ElasticBeanstalkApplicationVersion(ctx context.Context, cfg aws.Config, str return nil, nil } - var values []Resource + var values []models.Resource for _, item := range out.Applications { params := &elasticbeanstalk.DescribeApplicationVersionsInput{ ApplicationName: item.ApplicationName, @@ -302,7 +303,7 @@ func ElasticBeanstalkApplicationVersion(ctx context.Context, cfg aws.Config, str return values, nil } -func elasticBeanstalkApplicationVersionHandle(ctx context.Context, cfg aws.Config, v types.ApplicationVersionDescription) (Resource, error) { +func elasticBeanstalkApplicationVersionHandle(ctx context.Context, cfg aws.Config, v types.ApplicationVersionDescription) (models.Resource, error) { client := elasticbeanstalk.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) @@ -311,12 +312,12 @@ func elasticBeanstalkApplicationVersionHandle(ctx context.Context, cfg aws.Confi }) if err != nil { if !isErr(err, "ResourceNotFoundException") && !isErr(err, "InsufficientPrivilegesException") { - return Resource{}, err + return models.Resource{}, err } tags = &elasticbeanstalk.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ApplicationVersionArn, Name: *v.ApplicationName, diff --git a/provider/describer/elb.go b/provider/describer/elb.go index 9d6eb3bb..7c3ae7c4 100755 --- a/provider/describer/elb.go +++ b/provider/describer/elb.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "time" @@ -15,11 +16,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func ElasticLoadBalancingV2LoadBalancer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticLoadBalancingV2LoadBalancer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticloadbalancingv2.NewFromConfig(cfg) paginator := elasticloadbalancingv2.NewDescribeLoadBalancersPaginator(client, &elasticloadbalancingv2.DescribeLoadBalancersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -44,21 +45,21 @@ func ElasticLoadBalancingV2LoadBalancer(ctx context.Context, cfg aws.Config, str return values, nil } -func elasticLoadBalancingV2LoadBalancerHandle(ctx context.Context, cfg aws.Config, v types.LoadBalancer) (Resource, error) { +func elasticLoadBalancingV2LoadBalancerHandle(ctx context.Context, cfg aws.Config, v types.LoadBalancer) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticloadbalancingv2.NewFromConfig(cfg) attrs, err := client.DescribeLoadBalancerAttributes(ctx, &elasticloadbalancingv2.DescribeLoadBalancerAttributesInput{ LoadBalancerArn: v.LoadBalancerArn, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } tags, err := client.DescribeTags(ctx, &elasticloadbalancingv2.DescribeTagsInput{ ResourceArns: []string{*v.LoadBalancerArn}, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } description := model.ElasticLoadBalancingV2LoadBalancerDescription{ @@ -70,7 +71,7 @@ func elasticLoadBalancingV2LoadBalancerHandle(ctx context.Context, cfg aws.Confi description.Tags = tags.TagDescriptions[0].Tags } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.LoadBalancerArn, Name: *v.LoadBalancerName, @@ -78,7 +79,7 @@ func elasticLoadBalancingV2LoadBalancerHandle(ctx context.Context, cfg aws.Confi } return resource, nil } -func GetElasticLoadBalancingV2LoadBalancer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElasticLoadBalancingV2LoadBalancer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { lbARN := fields["arn"] client := elasticloadbalancingv2.NewFromConfig(cfg) out, err := client.DescribeLoadBalancers(ctx, &elasticloadbalancingv2.DescribeLoadBalancersInput{ @@ -88,7 +89,7 @@ func GetElasticLoadBalancingV2LoadBalancer(ctx context.Context, cfg aws.Config, return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.LoadBalancers { resource, err := elasticLoadBalancingV2LoadBalancerHandle(ctx, cfg, v) if err != nil { @@ -100,7 +101,7 @@ func GetElasticLoadBalancingV2LoadBalancer(ctx context.Context, cfg aws.Config, return values, nil } -func ElasticLoadBalancingV2Listener(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticLoadBalancingV2Listener(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { lbs, err := ElasticLoadBalancingV2LoadBalancer(ctx, cfg, nil) if err != nil { return nil, err @@ -108,7 +109,7 @@ func ElasticLoadBalancingV2Listener(ctx context.Context, cfg aws.Config, stream client := elasticloadbalancingv2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, lb := range lbs { arn := lb.Description.(model.ElasticLoadBalancingV2LoadBalancerDescription).LoadBalancer.LoadBalancerArn paginator := elasticloadbalancingv2.NewDescribeListenersPaginator(client, &elasticloadbalancingv2.DescribeListenersInput{ @@ -137,9 +138,9 @@ func ElasticLoadBalancingV2Listener(ctx context.Context, cfg aws.Config, stream return values, nil } -func elasticLoadBalancingV2ListenerHandle(ctx context.Context, v types.Listener) Resource { +func elasticLoadBalancingV2ListenerHandle(ctx context.Context, v types.Listener) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ListenerArn, Name: nameFromArn(*v.ListenerArn), @@ -149,7 +150,7 @@ func elasticLoadBalancingV2ListenerHandle(ctx context.Context, v types.Listener) } return resource } -func GetElasticLoadBalancingV2Listener(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElasticLoadBalancingV2Listener(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { lbArn := fields["load_balancer_arn"] listenerARN := fields["arn"] client := elasticloadbalancingv2.NewFromConfig(cfg) @@ -161,7 +162,7 @@ func GetElasticLoadBalancingV2Listener(ctx context.Context, cfg aws.Config, fiel return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Listeners { resource := elasticLoadBalancingV2ListenerHandle(ctx, v) values = append(values, resource) @@ -169,14 +170,14 @@ func GetElasticLoadBalancingV2Listener(ctx context.Context, cfg aws.Config, fiel return values, nil } -func ElasticLoadBalancingV2ListenerRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticLoadBalancingV2ListenerRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { listeners, err := ElasticLoadBalancingV2Listener(ctx, cfg, nil) if err != nil { return nil, err } client := elasticloadbalancingv2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, l := range listeners { arn := l.Description.(model.ElasticLoadBalancingV2ListenerDescription).Listener.ListenerArn err = PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { @@ -207,9 +208,9 @@ func ElasticLoadBalancingV2ListenerRule(ctx context.Context, cfg aws.Config, str return values, nil } -func elasticLoadBalancingV2ListenerRuleHandle(ctx context.Context, v types.Rule) Resource { +func elasticLoadBalancingV2ListenerRuleHandle(ctx context.Context, v types.Rule) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.RuleArn, Name: *v.RuleArn, @@ -219,9 +220,9 @@ func elasticLoadBalancingV2ListenerRuleHandle(ctx context.Context, v types.Rule) } return resource } -func GetElasticLoadBalancingV2ListenerRule(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElasticLoadBalancingV2ListenerRule(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] - var values []Resource + var values []models.Resource client := elasticloadbalancingv2.NewFromConfig(cfg) listeners, err := ElasticLoadBalancingV2Listener(ctx, cfg, nil) @@ -248,11 +249,11 @@ func GetElasticLoadBalancingV2ListenerRule(ctx context.Context, cfg aws.Config, return values, nil } -func ElasticLoadBalancingLoadBalancer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticLoadBalancingLoadBalancer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticloadbalancing.NewFromConfig(cfg) paginator := elasticloadbalancing.NewDescribeLoadBalancersPaginator(client, &elasticloadbalancing.DescribeLoadBalancersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -277,7 +278,7 @@ func ElasticLoadBalancingLoadBalancer(ctx context.Context, cfg aws.Config, strea return values, nil } -func elasticLoadBalancingLoadBalancerHandle(ctx context.Context, cfg aws.Config, v types3.LoadBalancerDescription) (Resource, error) { +func elasticLoadBalancingLoadBalancerHandle(ctx context.Context, cfg aws.Config, v types3.LoadBalancerDescription) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticloadbalancing.NewFromConfig(cfg) @@ -286,9 +287,9 @@ func elasticLoadBalancingLoadBalancerHandle(ctx context.Context, cfg aws.Config, }) if err != nil { if isErr(err, "DescribeLoadBalancerAttributesNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } tags, err := client.DescribeTags(ctx, &elasticloadbalancing.DescribeTagsInput{ @@ -296,9 +297,9 @@ func elasticLoadBalancingLoadBalancerHandle(ctx context.Context, cfg aws.Config, }) if err != nil { if isErr(err, "DescribeTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } description := model.ElasticLoadBalancingLoadBalancerDescription{ @@ -311,7 +312,7 @@ func elasticLoadBalancingLoadBalancerHandle(ctx context.Context, cfg aws.Config, } arn := "arn:" + describeCtx.Partition + ":elasticloadbalancing:" + describeCtx.Region + ":" + describeCtx.AccountID + ":loadbalancer/" + *v.LoadBalancerName - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.LoadBalancerName, @@ -319,7 +320,7 @@ func elasticLoadBalancingLoadBalancerHandle(ctx context.Context, cfg aws.Config, } return resource, nil } -func GetElasticLoadBalancingLoadBalancer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElasticLoadBalancingLoadBalancer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { LoadBalancerNames := fields["loadBalancerName"] client := elasticloadbalancing.NewFromConfig(cfg) @@ -329,7 +330,7 @@ func GetElasticLoadBalancingLoadBalancer(ctx context.Context, cfg aws.Config, fi if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, loadBalancer := range out.LoadBalancerDescriptions { resource, err := elasticLoadBalancingLoadBalancerHandle(ctx, cfg, loadBalancer) if err != nil { @@ -340,12 +341,12 @@ func GetElasticLoadBalancingLoadBalancer(ctx context.Context, cfg aws.Config, fi return values, nil } -func ElasticLoadBalancingV2SslPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticLoadBalancingV2SslPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticloadbalancingv2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeSSLPolicies(ctx, &elasticloadbalancingv2.DescribeSSLPoliciesInput{ Marker: prevToken, @@ -356,7 +357,7 @@ func ElasticLoadBalancingV2SslPolicy(ctx context.Context, cfg aws.Config, stream for _, v := range output.SslPolicies { arn := fmt.Sprintf("arn:%s:elbv2:%s:%s:ssl-policy/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.Name) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *v.Name, ARN: arn, @@ -383,11 +384,11 @@ func ElasticLoadBalancingV2SslPolicy(ctx context.Context, cfg aws.Config, stream return values, nil } -func ElasticLoadBalancingV2TargetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ElasticLoadBalancingV2TargetGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := elasticloadbalancingv2.NewFromConfig(cfg) paginator := elasticloadbalancingv2.NewDescribeTargetGroupsPaginator(client, &elasticloadbalancingv2.DescribeTargetGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -400,7 +401,7 @@ func ElasticLoadBalancingV2TargetGroup(ctx context.Context, cfg aws.Config, stre if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -417,7 +418,7 @@ func ElasticLoadBalancingV2TargetGroup(ctx context.Context, cfg aws.Config, stre return values, nil } -func elasticLoadBalancingV2TargetGroupHandle(ctx context.Context, cfg aws.Config, v types.TargetGroup) (Resource, error) { +func elasticLoadBalancingV2TargetGroupHandle(ctx context.Context, cfg aws.Config, v types.TargetGroup) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticloadbalancingv2.NewFromConfig(cfg) healthDescriptions, err := client.DescribeTargetHealth(ctx, &elasticloadbalancingv2.DescribeTargetHealthInput{ @@ -425,9 +426,9 @@ func elasticLoadBalancingV2TargetGroupHandle(ctx context.Context, cfg aws.Config }) if err != nil { if isErr(err, "DescribeTargetHealthNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } tags, err := client.DescribeTags(ctx, &elasticloadbalancingv2.DescribeTagsInput{ @@ -435,9 +436,9 @@ func elasticLoadBalancingV2TargetGroupHandle(ctx context.Context, cfg aws.Config }) if err != nil { if isErr(err, "DescribeTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } var tagsA []types.Tag @@ -445,7 +446,7 @@ func elasticLoadBalancingV2TargetGroupHandle(ctx context.Context, cfg aws.Config tagsA = tags.TagDescriptions[0].Tags } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TargetGroupArn, Name: *v.TargetGroupName, @@ -457,7 +458,7 @@ func elasticLoadBalancingV2TargetGroupHandle(ctx context.Context, cfg aws.Config } return resource, nil } -func GetElasticLoadBalancingV2TargetGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetElasticLoadBalancingV2TargetGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { targetGroupArn := fields["targetGroupArn"] client := elasticloadbalancingv2.NewFromConfig(cfg) resource, err := client.DescribeTargetGroups(ctx, &elasticloadbalancingv2.DescribeTargetGroupsInput{ @@ -470,13 +471,13 @@ func GetElasticLoadBalancingV2TargetGroup(ctx context.Context, cfg aws.Config, f return nil, err } - var values []Resource + var values []models.Resource for _, v := range resource.TargetGroups { resource, err := elasticLoadBalancingV2TargetGroupHandle(ctx, cfg, v) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -486,12 +487,12 @@ func GetElasticLoadBalancingV2TargetGroup(ctx context.Context, cfg aws.Config, f return values, nil } -func ApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticloadbalancingv2.NewFromConfig(cfg) paginator := elasticloadbalancingv2.NewDescribeLoadBalancersPaginator(client, &elasticloadbalancingv2.DescribeLoadBalancersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -508,7 +509,7 @@ func ApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.Conf return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s", arn, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.ApplicationLoadBalancerMetricRequestCountDescription{ @@ -529,7 +530,7 @@ func ApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.Conf return values, nil } -func GetApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) loadBalancerARN := fields["arn"] client := elasticloadbalancingv2.NewFromConfig(cfg) @@ -540,7 +541,7 @@ func GetApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.C return nil, err } - var values []Resource + var values []models.Resource for _, loadBalancer := range out.LoadBalancers { if loadBalancer.Type != types.LoadBalancerTypeEnumApplication { continue @@ -551,7 +552,7 @@ func GetApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.C return nil, err } for _, metric := range metrics { - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s", arn, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.ApplicationLoadBalancerMetricRequestCountDescription{ @@ -564,12 +565,12 @@ func GetApplicationLoadBalancerMetricRequestCount(ctx context.Context, cfg aws.C return values, nil } -func ApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticloadbalancingv2.NewFromConfig(cfg) paginator := elasticloadbalancingv2.NewDescribeLoadBalancersPaginator(client, &elasticloadbalancingv2.DescribeLoadBalancersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -586,7 +587,7 @@ func ApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg aws return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s", arn, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.ApplicationLoadBalancerMetricRequestCountDailyDescription{ @@ -607,7 +608,7 @@ func ApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg aws return values, nil } -func GetApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) loadBalancerARN := fields["arn"] @@ -617,7 +618,7 @@ func GetApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg return nil, err } - var values []Resource + var values []models.Resource for _, loadBalancer := range out.LoadBalancers { if loadBalancer.Type != types.LoadBalancerTypeEnumApplication { continue @@ -628,7 +629,7 @@ func GetApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg return nil, err } for _, metric := range metrics { - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s", arn, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.ApplicationLoadBalancerMetricRequestCountDailyDescription{ @@ -641,12 +642,12 @@ func GetApplicationLoadBalancerMetricRequestCountDaily(ctx context.Context, cfg return values, nil } -func NetworkLoadBalancerMetricNetFlowCount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func NetworkLoadBalancerMetricNetFlowCount(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticloadbalancingv2.NewFromConfig(cfg) paginator := elasticloadbalancingv2.NewDescribeLoadBalancersPaginator(client, &elasticloadbalancingv2.DescribeLoadBalancersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -663,7 +664,7 @@ func NetworkLoadBalancerMetricNetFlowCount(ctx context.Context, cfg aws.Config, return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s", arn, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.NetworkLoadBalancerMetricNetFlowCountDescription{ @@ -684,12 +685,12 @@ func NetworkLoadBalancerMetricNetFlowCount(ctx context.Context, cfg aws.Config, return values, nil } -func NetworkLoadBalancerMetricNetFlowCountDaily(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func NetworkLoadBalancerMetricNetFlowCountDaily(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := elasticloadbalancingv2.NewFromConfig(cfg) paginator := elasticloadbalancingv2.NewDescribeLoadBalancersPaginator(client, &elasticloadbalancingv2.DescribeLoadBalancersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -706,7 +707,7 @@ func NetworkLoadBalancerMetricNetFlowCountDaily(ctx context.Context, cfg aws.Con return nil, err } for _, metric := range metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s:%s:%s:%s", arn, metric.Timestamp.Format(time.RFC3339), *metric.DimensionName, *metric.DimensionValue), Description: model.NetworkLoadBalancerMetricNetFlowCountDailyDescription{ diff --git a/provider/describer/emr.go b/provider/describer/emr.go index e2011cb2..f0a590c5 100755 --- a/provider/describer/emr.go +++ b/provider/describer/emr.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/emr" @@ -11,11 +12,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func EMRCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EMRCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := emr.NewFromConfig(cfg) paginator := emr.NewListClustersPaginator(client, &emr.ListClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -24,7 +25,7 @@ func EMRCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re for _, item := range page.Clusters { resource, err := eMRClusterHandle(ctx, cfg, *item.Id) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -43,7 +44,7 @@ func EMRCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re } return values, nil } -func eMRClusterHandle(ctx context.Context, cfg aws.Config, clusterId string) (Resource, error) { +func eMRClusterHandle(ctx context.Context, cfg aws.Config, clusterId string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := emr.NewFromConfig(cfg) @@ -52,12 +53,12 @@ func eMRClusterHandle(ctx context.Context, cfg aws.Config, clusterId string) (Re }) if err != nil { if isErr(err, "DescribeClusterNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *out.Cluster.ClusterArn, Name: *out.Cluster.Name, @@ -67,12 +68,12 @@ func eMRClusterHandle(ctx context.Context, cfg aws.Config, clusterId string) (Re } return resource, nil } -func GetEMRCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEMRCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterId := fields["id"] - var values []Resource + var values []models.Resource resource, err := eMRClusterHandle(ctx, cfg, clusterId) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -84,11 +85,11 @@ func GetEMRCluster(ctx context.Context, cfg aws.Config, fields map[string]string return values, nil } -func EMRInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EMRInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := emr.NewFromConfig(cfg) clusterPaginator := emr.NewListClustersPaginator(client, &emr.ListClustersInput{}) - var values []Resource + var values []models.Resource for clusterPaginator.HasMorePages() { clusterPage, err := clusterPaginator.NextPage(ctx) if err != nil { @@ -109,7 +110,7 @@ func EMRInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R for _, instance := range instancePage.Instances { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:emr:%s:%s:instance/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *instance.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *instance.Id, ARN: arn, @@ -132,11 +133,11 @@ func EMRInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func EMRInstanceFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EMRInstanceFleet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := emr.NewFromConfig(cfg) clusterPaginator := emr.NewListClustersPaginator(client, &emr.ListClustersInput{}) - var values []Resource + var values []models.Resource for clusterPaginator.HasMorePages() { clusterPage, err := clusterPaginator.NextPage(ctx) if err != nil { @@ -172,10 +173,10 @@ func EMRInstanceFleet(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func eMRInstanceFleetHandle(ctx context.Context, instanceFleet types.InstanceFleet, clusterId string) Resource { +func eMRInstanceFleetHandle(ctx context.Context, instanceFleet types.InstanceFleet, clusterId string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:emr:%s:%s:instance-fleet/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *instanceFleet.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *instanceFleet.Id, Name: *instanceFleet.Name, @@ -187,8 +188,8 @@ func eMRInstanceFleetHandle(ctx context.Context, instanceFleet types.InstanceFle } return resource } -func GetEMRInstanceFleet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetEMRInstanceFleet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource clusterId := fields["clusterId"] client := emr.NewFromConfig(cfg) @@ -208,11 +209,11 @@ func GetEMRInstanceFleet(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func EMRInstanceGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EMRInstanceGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := emr.NewFromConfig(cfg) clusterPaginator := emr.NewListClustersPaginator(client, &emr.ListClustersInput{}) - var values []Resource + var values []models.Resource for clusterPaginator.HasMorePages() { clusterPage, err := clusterPaginator.NextPage(ctx) if err != nil { @@ -252,10 +253,10 @@ func EMRInstanceGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func eMRInstanceGroupHandle(ctx context.Context, instanceGroup types.InstanceGroup, clusterId string) Resource { +func eMRInstanceGroupHandle(ctx context.Context, instanceGroup types.InstanceGroup, clusterId string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:emr:%s:%s:instance-group/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *instanceGroup.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *instanceGroup.Id, ARN: arn, @@ -266,10 +267,10 @@ func eMRInstanceGroupHandle(ctx context.Context, instanceGroup types.InstanceGro } return resource } -func GetEMRInstanceGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetEMRInstanceGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterId := fields["clusterId"] client := emr.NewFromConfig(cfg) - var values []Resource + var values []models.Resource instances, err := client.ListInstanceGroups(ctx, &emr.ListInstanceGroupsInput{ ClusterId: &clusterId, @@ -287,15 +288,15 @@ func GetEMRInstanceGroup(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func EMRBlockPublicAccessConfiguration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EMRBlockPublicAccessConfiguration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := emr.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) op, err := client.GetBlockPublicAccessConfiguration(ctx, &emr.GetBlockPublicAccessConfigurationInput{}) if err != nil { return nil, err } - var values []Resource - resource := Resource{ + var values []models.Resource + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.EMRBlockPublicAccessConfigurationDescription{ Configuration: *op.BlockPublicAccessConfiguration, diff --git a/provider/describer/es.go b/provider/describer/es.go index 295a06d3..8cd74c23 100755 --- a/provider/describer/es.go +++ b/provider/describer/es.go @@ -5,14 +5,15 @@ import ( "math" "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" es "github.com/aws/aws-sdk-go-v2/service/elasticsearchservice" "github.com/opengovern/og-describer-aws/provider/model" ) -func ESDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { - var values []Resource +func ESDomain(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { + var values []models.Resource client := es.NewFromConfig(cfg) listNamesOut, err := client.ListDomainNames(ctx, &es.ListDomainNamesInput{}) @@ -39,7 +40,7 @@ func ESDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso for _, v := range out.DomainStatusList { resource, err := ESDomainHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -58,7 +59,7 @@ func ESDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso } return values, nil } -func ESDomainHandle(ctx context.Context, cfg aws.Config, v types.ElasticsearchDomainStatus) (Resource, error) { +func ESDomainHandle(ctx context.Context, cfg aws.Config, v types.ElasticsearchDomainStatus) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := es.NewFromConfig(cfg) @@ -67,12 +68,12 @@ func ESDomainHandle(ctx context.Context, cfg aws.Config, v types.ElasticsearchDo }) if err != nil { if isErr(err, "ListTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ARN, Name: *v.DomainName, @@ -83,9 +84,9 @@ func ESDomainHandle(ctx context.Context, cfg aws.Config, v types.ElasticsearchDo } return resource, nil } -func GetESDomain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetESDomain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { domainName := fields["domainName"] - var values []Resource + var values []models.Resource client := es.NewFromConfig(cfg) describeElasticSearch, err := client.DescribeElasticsearchDomain(ctx, &es.DescribeElasticsearchDomainInput{ @@ -96,7 +97,7 @@ func GetESDomain(ctx context.Context, cfg aws.Config, fields map[string]string) } resource, err := ESDomainHandle(ctx, cfg, *describeElasticSearch.DomainStatus) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/eventbridge.go b/provider/describer/eventbridge.go index b002b3af..3c336871 100755 --- a/provider/describer/eventbridge.go +++ b/provider/describer/eventbridge.go @@ -2,19 +2,20 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/eventbridge" "github.com/opengovern/og-describer-aws/provider/model" ) -func EventBridgeBus(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EventBridgeBus(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := eventbridge.NewFromConfig(cfg) input := eventbridge.ListEventBusesInput{Limit: aws.Int32(100)} - var values []Resource + var values []models.Resource for { response, err := client.ListEventBuses(ctx, &input) if err != nil { @@ -34,7 +35,7 @@ func EventBridgeBus(ctx context.Context, cfg aws.Config, stream *StreamSender) ( tagsOutput = &eventbridge.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *bus.Arn, Name: *bus.Name, @@ -60,11 +61,11 @@ func EventBridgeBus(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func EventBridgeRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func EventBridgeRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := eventbridge.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { listRulesOutput, err := client.ListRules(ctx, &eventbridge.ListRulesInput{ NextToken: prevToken, @@ -100,7 +101,7 @@ func EventBridgeRule(ctx context.Context, cfg aws.Config, stream *StreamSender) targets = &eventbridge.ListTargetsByRuleOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *rule.Arn, Name: *rule.Name, diff --git a/provider/describer/firehose.go b/provider/describer/firehose.go index 896ab2ba..0cf248b7 100755 --- a/provider/describer/firehose.go +++ b/provider/describer/firehose.go @@ -2,16 +2,17 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/firehose" "github.com/opengovern/og-describer-aws/provider/model" ) -func FirehoseDeliveryStream(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func FirehoseDeliveryStream(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := firehose.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (lastName *string, err error) { deliveryStreams, err := client.ListDeliveryStreams(ctx, &firehose.ListDeliveryStreamsInput{ @@ -27,7 +28,7 @@ func FirehoseDeliveryStream(ctx context.Context, cfg aws.Config, stream *StreamS if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -51,7 +52,7 @@ func FirehoseDeliveryStream(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func FirehoseDeliveryStreamHandle(ctx context.Context, cfg aws.Config, deliveryStreamName string) (Resource, error) { +func FirehoseDeliveryStreamHandle(ctx context.Context, cfg aws.Config, deliveryStreamName string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := firehose.NewFromConfig(cfg) @@ -60,9 +61,9 @@ func FirehoseDeliveryStreamHandle(ctx context.Context, cfg aws.Config, deliveryS }) if err != nil { if isErr(err, "DescribeDeliveryStreamNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } tags, err := client.ListTagsForDeliveryStream(ctx, &firehose.ListTagsForDeliveryStreamInput{ @@ -70,12 +71,12 @@ func FirehoseDeliveryStreamHandle(ctx context.Context, cfg aws.Config, deliveryS }) if err != nil { if isErr(err, "ListTagsForDeliveryStreamNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *deliveryStream.DeliveryStreamDescription.DeliveryStreamARN, Name: *deliveryStream.DeliveryStreamDescription.DeliveryStreamName, @@ -86,15 +87,15 @@ func FirehoseDeliveryStreamHandle(ctx context.Context, cfg aws.Config, deliveryS } return resource, nil } -func GetFirehoseDeliveryStream(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetFirehoseDeliveryStream(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { deliveryStreamName := fields["name"] - var values []Resource + var values []models.Resource resource, err := FirehoseDeliveryStreamHandle(ctx, cfg, deliveryStreamName) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/fms.go b/provider/describer/fms.go index 7f36415c..7c26b3b8 100755 --- a/provider/describer/fms.go +++ b/provider/describer/fms.go @@ -4,18 +4,19 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/fms/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/fms" "github.com/opengovern/og-describer-aws/provider/model" ) -func FMSPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func FMSPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := fms.NewFromConfig(cfg) paginator := fms.NewListPoliciesPaginator(client, &fms.ListPoliciesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -29,7 +30,7 @@ func FMSPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.PolicyArn, Name: *v.PolicyName, @@ -51,7 +52,7 @@ func FMSPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return values, nil } -func GetFMSPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetFMSPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) policyID := fields["id"] client := fms.NewFromConfig(cfg) @@ -61,14 +62,14 @@ func GetFMSPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, err } - var values []Resource + var values []models.Resource tags, err := client.ListTagsForResource(ctx, &fms.ListTagsForResourceInput{ ResourceArn: out.PolicyArn, }) if err != nil { return nil, err } - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *out.PolicyArn, Name: *out.Policy.PolicyName, diff --git a/provider/describer/fsx.go b/provider/describer/fsx.go index 74d81d3c..d9fd52eb 100755 --- a/provider/describer/fsx.go +++ b/provider/describer/fsx.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/fsx" @@ -9,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func FSXFileSystem(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func FSXFileSystem(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := fsx.NewFromConfig(cfg) paginator := fsx.NewDescribeFileSystemsPaginator(client, &fsx.DescribeFileSystemsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -34,9 +35,9 @@ func FSXFileSystem(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func fSXFileSystemHandle(ctx context.Context, item types.FileSystem) Resource { +func fSXFileSystemHandle(ctx context.Context, item types.FileSystem) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ResourceARN, Name: *item.FileSystemId, @@ -46,7 +47,7 @@ func fSXFileSystemHandle(ctx context.Context, item types.FileSystem) Resource { } return resource } -func GetFSXFileSystem(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetFSXFileSystem(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { filesystemId := fields["id"] client := fsx.NewFromConfig(cfg) @@ -60,18 +61,18 @@ func GetFSXFileSystem(ctx context.Context, cfg aws.Config, fields map[string]str return nil, err } - var values []Resource + var values []models.Resource for _, v := range filesystem.FileSystems { values = append(values, fSXFileSystemHandle(ctx, v)) } return values, nil } -func FSXStorageVirtualMachine(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func FSXStorageVirtualMachine(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := fsx.NewFromConfig(cfg) paginator := fsx.NewDescribeStorageVirtualMachinesPaginator(client, &fsx.DescribeStorageVirtualMachinesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -91,9 +92,9 @@ func FSXStorageVirtualMachine(ctx context.Context, cfg aws.Config, stream *Strea } return values, nil } -func fSXStorageVirtualMachineHandle(ctx context.Context, item types.StorageVirtualMachine) Resource { +func fSXStorageVirtualMachineHandle(ctx context.Context, item types.StorageVirtualMachine) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ResourceARN, Name: *item.Name, @@ -103,7 +104,7 @@ func fSXStorageVirtualMachineHandle(ctx context.Context, item types.StorageVirtu } return resource } -func GetFSXStorageVirtualMachine(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetFSXStorageVirtualMachine(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { storageVirtualMachineId := fields["id"] client := fsx.NewFromConfig(cfg) @@ -117,7 +118,7 @@ func GetFSXStorageVirtualMachine(ctx context.Context, cfg aws.Config, fields map return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.StorageVirtualMachines { values = append(values, fSXStorageVirtualMachineHandle(ctx, v)) } @@ -125,12 +126,12 @@ func GetFSXStorageVirtualMachine(ctx context.Context, cfg aws.Config, fields map return values, nil } -func FSXTask(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func FSXTask(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := fsx.NewFromConfig(cfg) paginator := fsx.NewDescribeDataRepositoryTasksPaginator(client, &fsx.DescribeDataRepositoryTasksInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -138,7 +139,7 @@ func FSXTask(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou } for _, item := range page.DataRepositoryTasks { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ResourceARN, Name: *item.TaskId, @@ -159,11 +160,11 @@ func FSXTask(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou return values, nil } -func FSXVolume(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func FSXVolume(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := fsx.NewFromConfig(cfg) paginator := fsx.NewDescribeVolumesPaginator(client, &fsx.DescribeVolumesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -184,9 +185,9 @@ func FSXVolume(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return values, nil } -func fSXVolumeHandle(ctx context.Context, item types.Volume) Resource { +func fSXVolumeHandle(ctx context.Context, item types.Volume) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ResourceARN, Name: *item.Name, @@ -196,7 +197,7 @@ func fSXVolumeHandle(ctx context.Context, item types.Volume) Resource { } return resource } -func GetFSXVolume(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetFSXVolume(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { volumeId := fields["id"] client := fsx.NewFromConfig(cfg) @@ -210,18 +211,18 @@ func GetFSXVolume(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, err } - var values []Resource + var values []models.Resource for _, item := range volumes.Volumes { values = append(values, fSXVolumeHandle(ctx, item)) } return values, nil } -func FSXSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func FSXSnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := fsx.NewFromConfig(cfg) paginator := fsx.NewDescribeSnapshotsPaginator(client, &fsx.DescribeSnapshotsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -242,9 +243,9 @@ func FSXSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func fSXSnapshotHandle(ctx context.Context, item types.Snapshot) Resource { +func fSXSnapshotHandle(ctx context.Context, item types.Snapshot) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.ResourceARN, Name: *item.Name, @@ -254,7 +255,7 @@ func fSXSnapshotHandle(ctx context.Context, item types.Snapshot) Resource { } return resource } -func GetFSXSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetFSXSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { snapshotId := fields["id"] client := fsx.NewFromConfig(cfg) @@ -268,7 +269,7 @@ func GetFSXSnapshot(ctx context.Context, cfg aws.Config, fields map[string]strin return nil, err } - var values []Resource + var values []models.Resource for _, item := range snapshot.Snapshots { values = append(values, fSXSnapshotHandle(ctx, item)) } diff --git a/provider/describer/glacier.go b/provider/describer/glacier.go index e1e9eb3e..921fb4f3 100755 --- a/provider/describer/glacier.go +++ b/provider/describer/glacier.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/glacier" @@ -9,7 +10,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func GlacierVault(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlacierVault(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := glacier.NewFromConfig(cfg) @@ -17,7 +18,7 @@ func GlacierVault(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] AccountId: &describeCtx.AccountID, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -76,7 +77,7 @@ func GlacierVault(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] vaultNotificationConfig = *notifications.VaultNotificationConfig } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *vault.VaultARN, Name: *vault.VaultName, @@ -103,7 +104,7 @@ func GlacierVault(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func GetGlacierVault(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlacierVault(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) vaultName := fields["name"] @@ -119,7 +120,7 @@ func GetGlacierVault(ctx context.Context, cfg aws.Config, fields map[string]stri return nil, nil } - var values []Resource + var values []models.Resource accessPolicy, err := client.GetVaultAccessPolicy(ctx, &glacier.GetVaultAccessPolicyInput{ AccountId: &describeCtx.AccountID, VaultName: vault.VaultName, @@ -155,7 +156,7 @@ func GetGlacierVault(ctx context.Context, cfg aws.Config, fields map[string]stri tags = &glacier.ListTagsForVaultOutput{} } - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *vault.VaultARN, Name: *vault.VaultName, diff --git a/provider/describer/globalaccelerator.go b/provider/describer/globalaccelerator.go index c844cd44..1414f499 100755 --- a/provider/describer/globalaccelerator.go +++ b/provider/describer/globalaccelerator.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/globalaccelerator" @@ -9,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func GlobalAcceleratorAccelerator(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlobalAcceleratorAccelerator(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := globalaccelerator.NewFromConfig(cfg) paginator := globalaccelerator.NewListAcceleratorsPaginator(client, &globalaccelerator.ListAcceleratorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -47,9 +48,9 @@ func GlobalAcceleratorAccelerator(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func globalAcceleratorAcceleratorHandle(ctx context.Context, attribute *globalaccelerator.DescribeAcceleratorAttributesOutput, tags *globalaccelerator.ListTagsForResourceOutput, accelerator types.Accelerator) Resource { +func globalAcceleratorAcceleratorHandle(ctx context.Context, attribute *globalaccelerator.DescribeAcceleratorAttributesOutput, tags *globalaccelerator.ListTagsForResourceOutput, accelerator types.Accelerator) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *accelerator.AcceleratorArn, Name: *accelerator.Name, @@ -61,10 +62,10 @@ func globalAcceleratorAcceleratorHandle(ctx context.Context, attribute *globalac } return resource } -func GetGlobalAcceleratorAccelerator(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlobalAcceleratorAccelerator(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { acceleratorArn := fields["arn"] client := globalaccelerator.NewFromConfig(cfg) - var values []Resource + var values []models.Resource accelerator, err := client.DescribeAccelerator(ctx, &globalaccelerator.DescribeAcceleratorInput{ AcceleratorArn: &acceleratorArn, @@ -101,11 +102,11 @@ func GetGlobalAcceleratorAccelerator(ctx context.Context, cfg aws.Config, fields return values, nil } -func GlobalAcceleratorListener(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlobalAcceleratorListener(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := globalaccelerator.NewFromConfig(cfg) paginator := globalaccelerator.NewListAcceleratorsPaginator(client, &globalaccelerator.ListAcceleratorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -139,9 +140,9 @@ func GlobalAcceleratorListener(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func globalAcceleratorListenerHandle(ctx context.Context, listener types.Listener, ARN string) Resource { +func globalAcceleratorListenerHandle(ctx context.Context, listener types.Listener, ARN string) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *listener.ListenerArn, Name: *listener.ListenerArn, @@ -152,8 +153,8 @@ func globalAcceleratorListenerHandle(ctx context.Context, listener types.Listene } return resource } -func GetGlobalAcceleratorListener(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetGlobalAcceleratorListener(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource acceleratorArn := fields["arn"] client := globalaccelerator.NewFromConfig(cfg) accelerator, err := client.DescribeAccelerator(ctx, &globalaccelerator.DescribeAcceleratorInput{ @@ -183,11 +184,11 @@ func GetGlobalAcceleratorListener(ctx context.Context, cfg aws.Config, fields ma return values, nil } -func GlobalAcceleratorEndpointGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlobalAcceleratorEndpointGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := globalaccelerator.NewFromConfig(cfg) paginator := globalaccelerator.NewListAcceleratorsPaginator(client, &globalaccelerator.ListAcceleratorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -229,9 +230,9 @@ func GlobalAcceleratorEndpointGroup(ctx context.Context, cfg aws.Config, stream return values, nil } -func globalAcceleratorEndpointGroupHandle(ctx context.Context, endpointGroup types.EndpointGroup, listener types.Listener, ARN string) Resource { +func globalAcceleratorEndpointGroupHandle(ctx context.Context, endpointGroup types.EndpointGroup, listener types.Listener, ARN string) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *endpointGroup.EndpointGroupArn, Name: *endpointGroup.EndpointGroupArn, @@ -243,10 +244,10 @@ func globalAcceleratorEndpointGroupHandle(ctx context.Context, endpointGroup typ } return resource } -func GetGlobalAcceleratorEndpointGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlobalAcceleratorEndpointGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { acceleratorArn := fields["arn"] client := globalaccelerator.NewFromConfig(cfg) - var values []Resource + var values []models.Resource accelerator, err := client.DescribeAccelerator(ctx, &globalaccelerator.DescribeAcceleratorInput{ AcceleratorArn: &acceleratorArn, diff --git a/provider/describer/glue.go b/provider/describer/glue.go index cebace69..3abe23d0 100755 --- a/provider/describer/glue.go +++ b/provider/describer/glue.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/glue" @@ -12,11 +13,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func GlueCatalogDatabase(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueCatalogDatabase(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := glue.NewFromConfig(cfg) paginator := glue.NewGetDatabasesPaginator(client, &glue.GetDatabasesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -36,10 +37,10 @@ func GlueCatalogDatabase(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func glueCatalogDatabaseHandle(ctx context.Context, database types.Database) Resource { +func glueCatalogDatabaseHandle(ctx context.Context, database types.Database) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:aws:glue:%s:%s:database/%s", describeCtx.Region, describeCtx.AccountID, *database.Name) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *database.Name, ARN: arn, @@ -49,10 +50,10 @@ func glueCatalogDatabaseHandle(ctx context.Context, database types.Database) Res } return resource } -func GetGlueCatalogDatabase(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlueCatalogDatabase(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := glue.NewFromConfig(cfg) - var values []Resource + var values []models.Resource out, err := client.GetDatabase(ctx, &glue.GetDatabaseInput{ Name: &name, @@ -69,13 +70,13 @@ func GetGlueCatalogDatabase(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func GlueCatalogTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueCatalogTable(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := glue.NewFromConfig(cfg) paginator := glue.NewGetDatabasesPaginator(client, &glue.GetDatabasesInput{}) lakeformationClient := lakeformation.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -111,7 +112,7 @@ func GlueCatalogTable(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func glueCatalogTableHandle(ctx context.Context, client *lakeformation.Client, table types.Table, databaseName string) (*Resource, error) { +func glueCatalogTableHandle(ctx context.Context, client *lakeformation.Client, table types.Table, databaseName string) (*models.Resource, error) { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:aws:glue:%s:%s:table/%s/%s", describeCtx.Region, describeCtx.AccountID, databaseName, *table.Name) @@ -128,8 +129,8 @@ func glueCatalogTableHandle(ctx context.Context, client *lakeformation.Client, t params := &lakeformation.GetResourceLFTagsInput{ CatalogId: table.CatalogId, ShowAssignedLFTags: aws.Bool(true), - Resource: &lakeformationTypes.Resource{ - Table: &lakeformationTypes.TableResource{ + Resource: &lakeformationTypes.models.Resource, { + Table: &lakeformationTypes.Tablemodels.Resource{ CatalogId: table.CatalogId, DatabaseName: table.DatabaseName, Name: table.Name, @@ -146,7 +147,7 @@ func glueCatalogTableHandle(ctx context.Context, client *lakeformation.Client, t lfTableTags = lftags.LFTagsOnTable } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *table.Name, ARN: arn, @@ -157,7 +158,7 @@ func glueCatalogTableHandle(ctx context.Context, client *lakeformation.Client, t } return &resource, nil } -func GetGlueCatalogTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlueCatalogTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["databaseName"] catalogId := fields["catalogId"] client := glue.NewFromConfig(cfg) @@ -174,7 +175,7 @@ func GetGlueCatalogTable(ctx context.Context, cfg aws.Config, fields map[string] return nil, err } - var values []Resource + var values []models.Resource for _, table := range tables.TableList { value, err := glueCatalogTableHandle(ctx, lakeformationClient, table, name) if err != nil { @@ -185,11 +186,11 @@ func GetGlueCatalogTable(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func GlueConnection(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueConnection(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := glue.NewFromConfig(cfg) paginator := glue.NewGetConnectionsPaginator(client, &glue.GetConnectionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -209,10 +210,10 @@ func GlueConnection(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func glueConnectionHandle(ctx context.Context, connection types.Connection) Resource { +func glueConnectionHandle(ctx context.Context, connection types.Connection) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:aws:glue:%s:%s:connection/%s", describeCtx.Region, describeCtx.AccountID, *connection.Name) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *connection.Name, ARN: arn, @@ -222,7 +223,7 @@ func glueConnectionHandle(ctx context.Context, connection types.Connection) Reso } return resource } -func GetGlueConnection(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlueConnection(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := glue.NewFromConfig(cfg) @@ -237,17 +238,17 @@ func GetGlueConnection(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource connection := out.Connection values = append(values, glueConnectionHandle(ctx, *connection)) return values, nil } -func GlueCrawler(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueCrawler(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := glue.NewFromConfig(cfg) paginator := glue.NewGetCrawlersPaginator(client, &glue.GetCrawlersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -267,10 +268,10 @@ func GlueCrawler(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func glueCrawlerHandle(ctx context.Context, crawler types.Crawler) Resource { +func glueCrawlerHandle(ctx context.Context, crawler types.Crawler) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:aws:glue:%s:%s:crawler/%s", describeCtx.Region, describeCtx.AccountID, *crawler.Name) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *crawler.Name, ARN: arn, @@ -280,7 +281,7 @@ func glueCrawlerHandle(ctx context.Context, crawler types.Crawler) Resource { } return resource } -func GetGlueCrawler(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlueCrawler(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := glue.NewFromConfig(cfg) @@ -296,12 +297,12 @@ func GetGlueCrawler(ctx context.Context, cfg aws.Config, fields map[string]strin } crawler := out.Crawler - var values []Resource + var values []models.Resource values = append(values, glueCrawlerHandle(ctx, *crawler)) return values, nil } -func GlueDataCatalogEncryptionSettings(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueDataCatalogEncryptionSettings(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := glue.NewFromConfig(cfg) settings, err := client.GetDataCatalogEncryptionSettings(ctx, &glue.GetDataCatalogEncryptionSettingsInput{}) @@ -309,7 +310,7 @@ func GlueDataCatalogEncryptionSettings(ctx context.Context, cfg aws.Config, stre return nil, err } - var values []Resource + var values []models.Resource resource := glueDataCatalogEncryptionSettingsHandle(ctx, settings) if stream != nil { if err := (*stream)(resource); err != nil { @@ -321,9 +322,9 @@ func GlueDataCatalogEncryptionSettings(ctx context.Context, cfg aws.Config, stre return values, nil } -func glueDataCatalogEncryptionSettingsHandle(ctx context.Context, settings *glue.GetDataCatalogEncryptionSettingsOutput) Resource { +func glueDataCatalogEncryptionSettingsHandle(ctx context.Context, settings *glue.GetDataCatalogEncryptionSettingsOutput) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.GlueDataCatalogEncryptionSettingsDescription{ DataCatalogEncryptionSettings: *settings.DataCatalogEncryptionSettings, @@ -331,7 +332,7 @@ func glueDataCatalogEncryptionSettingsHandle(ctx context.Context, settings *glue } return resource } -func GetGlueDataCatalogEncryptionSettings(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlueDataCatalogEncryptionSettings(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { catalogId := fields["catalogId"] client := glue.NewFromConfig(cfg) @@ -345,17 +346,17 @@ func GetGlueDataCatalogEncryptionSettings(ctx context.Context, cfg aws.Config, f return nil, err } - var values []Resource + var values []models.Resource values = append(values, glueDataCatalogEncryptionSettingsHandle(ctx, settings)) return values, nil } -func GlueDataQualityRuleset(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueDataQualityRuleset(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := glue.NewFromConfig(cfg) paginator := glue.NewListDataQualityRulesetsPaginator(client, &glue.ListDataQualityRulesetsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -369,7 +370,7 @@ func GlueDataQualityRuleset(ctx context.Context, cfg aws.Config, stream *StreamS return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *listRuleset.Name, Description: model.GlueDataQualityRulesetDescription{ @@ -390,11 +391,11 @@ func GlueDataQualityRuleset(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func GlueDevEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueDevEndpoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := glue.NewFromConfig(cfg) paginator := glue.NewGetDevEndpointsPaginator(client, &glue.GetDevEndpointsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -414,10 +415,10 @@ func GlueDevEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func glueDevEndpointHandle(ctx context.Context, devEndpoint types.DevEndpoint) Resource { +func glueDevEndpointHandle(ctx context.Context, devEndpoint types.DevEndpoint) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:aws:glue:%s:%s:devEndpoint/%s", describeCtx.Region, describeCtx.AccountID, *devEndpoint.EndpointName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *devEndpoint.EndpointName, ARN: arn, @@ -427,7 +428,7 @@ func glueDevEndpointHandle(ctx context.Context, devEndpoint types.DevEndpoint) R } return resource } -func GetGlueDevEndpoint(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlueDevEndpoint(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { endpointName := fields["name"] client := glue.NewFromConfig(cfg) @@ -441,16 +442,16 @@ func GetGlueDevEndpoint(ctx context.Context, cfg aws.Config, fields map[string]s return nil, err } - var values []Resource + var values []models.Resource values = append(values, glueDevEndpointHandle(ctx, *out.DevEndpoint)) return values, nil } -func GlueJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueJob(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := glue.NewFromConfig(cfg) paginator := glue.NewGetJobsPaginator(client, &glue.GetJobsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -470,7 +471,7 @@ func GlueJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou return values, nil } -func glueJobHandle(ctx context.Context, cfg aws.Config, job types.Job) Resource { +func glueJobHandle(ctx context.Context, cfg aws.Config, job types.Job) models.Resource { describeCtx := GetDescribeContext(ctx) client := glue.NewFromConfig(cfg) @@ -483,7 +484,7 @@ func glueJobHandle(ctx context.Context, cfg aws.Config, job types.Job) Resource bookmark = &glue.GetJobBookmarkOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *job.Name, ARN: arn, @@ -494,12 +495,12 @@ func glueJobHandle(ctx context.Context, cfg aws.Config, job types.Job) Resource } return resource } -func GetGlueJob(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlueJob(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { jobName := fields["name"] client := glue.NewFromConfig(cfg) - var values []Resource + var values []models.Resource out, err := client.GetJob(ctx, &glue.GetJobInput{ JobName: &jobName, }) @@ -514,11 +515,11 @@ func GetGlueJob(ctx context.Context, cfg aws.Config, fields map[string]string) ( return values, nil } -func GlueSecurityConfiguration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GlueSecurityConfiguration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := glue.NewFromConfig(cfg) paginator := glue.NewGetSecurityConfigurationsPaginator(client, &glue.GetSecurityConfigurationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -538,10 +539,10 @@ func GlueSecurityConfiguration(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func glueSecurityConfigurationHandle(ctx context.Context, securityConfiguration types.SecurityConfiguration) Resource { +func glueSecurityConfigurationHandle(ctx context.Context, securityConfiguration types.SecurityConfiguration) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:aws:glue:%s:%s:security-configuration/%s", describeCtx.Region, describeCtx.AccountID, *securityConfiguration.Name) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *securityConfiguration.Name, ARN: arn, @@ -551,7 +552,7 @@ func glueSecurityConfigurationHandle(ctx context.Context, securityConfiguration } return resource } -func GetGlueSecurityConfiguration(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGlueSecurityConfiguration(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] client := glue.NewFromConfig(cfg) @@ -565,7 +566,7 @@ func GetGlueSecurityConfiguration(ctx context.Context, cfg aws.Config, fields ma return nil, err } - var values []Resource + var values []models.Resource values = append(values, glueSecurityConfigurationHandle(ctx, *out.SecurityConfiguration)) return values, nil } diff --git a/provider/describer/grafana.go b/provider/describer/grafana.go index 61eb748b..b60d8cfd 100755 --- a/provider/describer/grafana.go +++ b/provider/describer/grafana.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/grafana" @@ -10,11 +11,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func GrafanaWorkspace(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GrafanaWorkspace(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := grafana.NewFromConfig(cfg) paginator := grafana.NewListWorkspacesPaginator(client, &grafana.ListWorkspacesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -35,11 +36,11 @@ func GrafanaWorkspace(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func grafanaWorkspaceHandle(ctx context.Context, v types.WorkspaceSummary) Resource { +func grafanaWorkspaceHandle(ctx context.Context, v types.WorkspaceSummary) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:grafana:%s:%s:/workspaces/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.Id, @@ -49,7 +50,7 @@ func grafanaWorkspaceHandle(ctx context.Context, v types.WorkspaceSummary) Resou } return resource } -func GetGrafanaWorkspace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGrafanaWorkspace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { workspaceId := fields["workspaceId"] client := grafana.NewFromConfig(cfg) @@ -77,7 +78,7 @@ func GetGrafanaWorkspace(ctx context.Context, cfg aws.Config, fields map[string] Tags: out.Workspace.Tags, } - var values []Resource + var values []models.Resource values = append(values, grafanaWorkspaceHandle(ctx, workspace)) return values, nil } diff --git a/provider/describer/guardduty.go b/provider/describer/guardduty.go index 3ce15dff..0d0a2e8a 100755 --- a/provider/describer/guardduty.go +++ b/provider/describer/guardduty.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/guardduty" @@ -10,9 +11,9 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func GuardDutyFinding(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GuardDutyFinding(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) - var values []Resource + var values []models.Resource client := guardduty.NewFromConfig(cfg) @@ -46,7 +47,7 @@ func GuardDutyFinding(ctx context.Context, cfg aws.Config, stream *StreamSender) } for _, item := range findings.Findings { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *item.Arn, Name: *item.Id, @@ -68,10 +69,10 @@ func GuardDutyFinding(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func GuardDutyDetector(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GuardDutyDetector(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := guardduty.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := guardduty.NewListDetectorsPaginator(client, &guardduty.ListDetectorsInput{}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -99,11 +100,11 @@ func GuardDutyDetector(ctx context.Context, cfg aws.Config, stream *StreamSender } return values, nil } -func guardDutyDetectorHandle(ctx context.Context, out *guardduty.GetDetectorOutput, id string) Resource { +func guardDutyDetectorHandle(ctx context.Context, out *guardduty.GetDetectorOutput, id string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":guardduty:" + describeCtx.Region + ":" + describeCtx.AccountID + ":detector/" + id - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: id, @@ -114,10 +115,10 @@ func guardDutyDetectorHandle(ctx context.Context, out *guardduty.GetDetectorOutp } return resource } -func GetGuardDutyDetector(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGuardDutyDetector(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { detectorId := fields["id"] client := guardduty.NewFromConfig(cfg) - var values []Resource + var values []models.Resource out, err := client.GetDetector(ctx, &guardduty.GetDetectorInput{ DetectorId: &detectorId, @@ -134,11 +135,11 @@ func GetGuardDutyDetector(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func GuardDutyFilter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GuardDutyFilter(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := guardduty.NewFromConfig(cfg) paginator := guardduty.NewListDetectorsPaginator(client, &guardduty.ListDetectorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -180,11 +181,11 @@ func GuardDutyFilter(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func guardDutyFilterHandle(ctx context.Context, filterOutput *guardduty.GetFilterOutput, detectorId string, filter string) Resource { +func guardDutyFilterHandle(ctx context.Context, filterOutput *guardduty.GetFilterOutput, detectorId string, filter string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:guardduty:%s:%s:detector/%s/filter/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, detectorId, filter) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *filterOutput.Name, @@ -195,7 +196,7 @@ func guardDutyFilterHandle(ctx context.Context, filterOutput *guardduty.GetFilte } return resource } -func GetGuardDutyFilter(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetGuardDutyFilter(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { detectorId := field["id"] client := guardduty.NewFromConfig(cfg) @@ -209,7 +210,7 @@ func GetGuardDutyFilter(ctx context.Context, cfg aws.Config, field map[string]st return nil, err } - var values []Resource + var values []models.Resource for _, filter := range out.FilterNames { filterOutput, err := client.GetFilter(ctx, &guardduty.GetFilterInput{ DetectorId: &detectorId, @@ -228,10 +229,10 @@ func GetGuardDutyFilter(ctx context.Context, cfg aws.Config, field map[string]st return values, nil } -func GuardDutyIPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GuardDutyIPSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := guardduty.NewFromConfig(cfg) paginator := guardduty.NewListDetectorsPaginator(client, &guardduty.ListDetectorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -271,11 +272,11 @@ func GuardDutyIPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } return values, nil } -func guardDutyIPSetHandle(ctx context.Context, ipSetOutput *guardduty.GetIPSetOutput, ipSetId string, detectorId string) Resource { +func guardDutyIPSetHandle(ctx context.Context, ipSetOutput *guardduty.GetIPSetOutput, ipSetId string, detectorId string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:guardduty:%s:%s:detector/%s/ipset/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, detectorId, ipSetId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *ipSetOutput.Name, @@ -287,7 +288,7 @@ func guardDutyIPSetHandle(ctx context.Context, ipSetOutput *guardduty.GetIPSetOu } return resource } -func GetGuardDutyIPSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGuardDutyIPSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { detectorId := fields["id"] client := guardduty.NewFromConfig(cfg) @@ -301,7 +302,7 @@ func GetGuardDutyIPSet(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource for _, ipSetId := range out.IpSetIds { ipSetOutput, err := client.GetIPSet(ctx, &guardduty.GetIPSetInput{ DetectorId: &detectorId, @@ -319,11 +320,11 @@ func GetGuardDutyIPSet(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func GuardDutyMember(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GuardDutyMember(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := guardduty.NewFromConfig(cfg) paginator := guardduty.NewListDetectorsPaginator(client, &guardduty.ListDetectorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -356,9 +357,9 @@ func GuardDutyMember(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func guardDutyMemberHandle(ctx context.Context, member types.Member) Resource { +func guardDutyMemberHandle(ctx context.Context, member types.Member) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *member.AccountId, Description: model.GuardDutyMemberDescription{ @@ -367,7 +368,7 @@ func guardDutyMemberHandle(ctx context.Context, member types.Member) Resource { } return resource } -func GetGuardDutyMember(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGuardDutyMember(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { memberId := fields["id"] client := guardduty.NewFromConfig(cfg) @@ -381,7 +382,7 @@ func GetGuardDutyMember(ctx context.Context, cfg aws.Config, fields map[string]s return nil, err } - var values []Resource + var values []models.Resource for _, member := range members.Members { resource := guardDutyMemberHandle(ctx, member) values = append(values, resource) @@ -389,11 +390,11 @@ func GetGuardDutyMember(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func GuardDutyPublishingDestination(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GuardDutyPublishingDestination(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := guardduty.NewFromConfig(cfg) paginator := guardduty.NewListDetectorsPaginator(client, &guardduty.ListDetectorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -434,11 +435,11 @@ func GuardDutyPublishingDestination(ctx context.Context, cfg aws.Config, stream } return values, nil } -func guardDutyPublishingDestinationHandle(ctx context.Context, detectorId string, destinationOutput *guardduty.DescribePublishingDestinationOutput, destination types.Destination) Resource { +func guardDutyPublishingDestinationHandle(ctx context.Context, detectorId string, destinationOutput *guardduty.DescribePublishingDestinationOutput, destination types.Destination) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:guardduty:%s:%s:detector/%s/publishingDestination/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, detectorId, *destination.DestinationId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *destinationOutput.DestinationId, @@ -449,7 +450,7 @@ func guardDutyPublishingDestinationHandle(ctx context.Context, detectorId string } return resource } -func GetGuardDutyPublishingDestination(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGuardDutyPublishingDestination(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { detectorId := fields["id"] client := guardduty.NewFromConfig(cfg) @@ -463,7 +464,7 @@ func GetGuardDutyPublishingDestination(ctx context.Context, cfg aws.Config, fiel return nil, err } - var values []Resource + var values []models.Resource for _, destination := range publishingDestinations.Destinations { destinationOutput, err := client.DescribePublishingDestination(ctx, &guardduty.DescribePublishingDestinationInput{ DestinationId: destination.DestinationId, @@ -482,11 +483,11 @@ func GetGuardDutyPublishingDestination(ctx context.Context, cfg aws.Config, fiel return values, nil } -func GuardDutyThreatIntelSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func GuardDutyThreatIntelSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := guardduty.NewFromConfig(cfg) paginator := guardduty.NewListDetectorsPaginator(client, &guardduty.ListDetectorsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -527,11 +528,11 @@ func GuardDutyThreatIntelSet(ctx context.Context, cfg aws.Config, stream *Stream } return values, nil } -func guardDutyThreatIntelSetHandle(ctx context.Context, threatIntelSetOutput *guardduty.GetThreatIntelSetOutput, detectorId string, threatIntelSetId string) Resource { +func guardDutyThreatIntelSetHandle(ctx context.Context, threatIntelSetOutput *guardduty.GetThreatIntelSetOutput, detectorId string, threatIntelSetId string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:guardduty:%s:%s:detector/%s/threatintelset/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, detectorId, threatIntelSetId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *threatIntelSetOutput.Name, @@ -543,7 +544,7 @@ func guardDutyThreatIntelSetHandle(ctx context.Context, threatIntelSetOutput *gu } return resource } -func GetGuardDutyThreatIntelSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetGuardDutyThreatIntelSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { detectorId := fields["id"] client := guardduty.NewFromConfig(cfg) @@ -557,7 +558,7 @@ func GetGuardDutyThreatIntelSet(ctx context.Context, cfg aws.Config, fields map[ return nil, err } - var values []Resource + var values []models.Resource for _, threatIntelSetId := range threatIntelSets.ThreatIntelSetIds { threatIntelSetOutput, err := client.GetThreatIntelSet(ctx, &guardduty.GetThreatIntelSetInput{ DetectorId: &detectorId, diff --git a/provider/describer/health.go b/provider/describer/health.go index ef3b7bdd..a8ca1d48 100755 --- a/provider/describer/health.go +++ b/provider/describer/health.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/service/health/types" @@ -10,12 +11,12 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func HealthEvent(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func HealthEvent(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := health.NewFromConfig(cfg) paginator := health.NewDescribeEventsPaginator(client, &health.DescribeEventsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -23,7 +24,7 @@ func HealthEvent(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R } for _, event := range page.Events { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *event.Arn, Description: model.HealthEventDescription{ @@ -42,12 +43,12 @@ func HealthEvent(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func HealthAffectedEntity(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func HealthAffectedEntity(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := health.NewFromConfig(cfg) paginator := health.NewDescribeEventsPaginator(client, &health.DescribeEventsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -66,7 +67,7 @@ func HealthAffectedEntity(ctx context.Context, cfg aws.Config, stream *StreamSen return nil, err } for _, entity := range entitiesPage.Entities { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *event.Arn, Description: model.HealthAffectedEntityDescription{ diff --git a/provider/describer/iam.go b/provider/describer/iam.go index 4fce2f4f..ebacec1e 100755 --- a/provider/describer/iam.go +++ b/provider/describer/iam.go @@ -6,6 +6,7 @@ import ( "crypto/x509" "encoding/pem" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "time" @@ -24,10 +25,10 @@ const ( const maxRetries = 20 const retryIntervalMs = 1000 -func IAMAccessAdvisor(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMAccessAdvisor(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := iam.NewFromConfig(cfg) - var values []Resource + var values []models.Resource var arns []string @@ -116,7 +117,7 @@ func IAMAccessAdvisor(ctx context.Context, cfg aws.Config, stream *StreamSender) // Stream results for _, serviceLastAccessed := range resp.ServicesLastAccessed { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *serviceLastAccessed.ServiceName, ID: fmt.Sprintf("%s|%s", principal, *serviceLastAccessed.ServiceName), @@ -143,7 +144,7 @@ func IAMAccessAdvisor(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func IAMAccount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMAccount(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) orgClient := organizations.NewFromConfig(cfg) accountId, err := STSAccount(ctx, cfg) @@ -168,7 +169,7 @@ func IAMAccount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return nil, err } } - var values []Resource + var values []models.Resource for _, acc := range accounts.Accounts { var aliases []string @@ -185,7 +186,7 @@ func IAMAccount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *acc.Arn, ID: *acc.Id, @@ -208,7 +209,7 @@ func IAMAccount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func IAMAccountSummary(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMAccountSummary(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := iam.NewFromConfig(cfg) output, err := client.GetAccountSummary(ctx, &iam.GetAccountSummaryInput{}) @@ -259,8 +260,8 @@ func IAMAccountSummary(ctx context.Context, cfg aws.Config, stream *StreamSender return nil, err } - var values []Resource - resource := Resource{ + var values []models.Resource + resource := models.Resource{ Region: describeCtx.OGRegion, // No ID or ARN. Per Account Configuration Name: accountId + " Account Summary", @@ -278,8 +279,8 @@ func IAMAccountSummary(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func IAMAccountPasswordPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { - var values []Resource +func IAMAccountPasswordPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { + var values []models.Resource resource, err := iAMAccountPasswordPolicyHandle(ctx, cfg) if err != nil { return nil, err @@ -294,28 +295,28 @@ func IAMAccountPasswordPolicy(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func iAMAccountPasswordPolicyHandle(ctx context.Context, cfg aws.Config) (Resource, error) { +func iAMAccountPasswordPolicyHandle(ctx context.Context, cfg aws.Config) (models.Resource, error) { client := iam.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) output, err := client.GetAccountPasswordPolicy(ctx, &iam.GetAccountPasswordPolicyInput{}) if err != nil { if !isErr(err, "NoSuchEntity") { - return Resource{}, err + return models.Resource{}, err } output = &iam.GetAccountPasswordPolicyOutput{} } if output.PasswordPolicy == nil { - return Resource{}, nil + return models.Resource{}, nil } accountId, err := STSAccount(ctx, cfg) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, // No ID or ARN. Per Account Configuration Name: accountId + " IAM Password Policy", @@ -326,8 +327,8 @@ func iAMAccountPasswordPolicyHandle(ctx context.Context, cfg aws.Config) (Resour return resource, nil } -func GetIAMAccountPasswordPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetIAMAccountPasswordPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource resource, err := iAMAccountPasswordPolicyHandle(ctx, cfg) if err != nil { return nil, err @@ -336,10 +337,10 @@ func GetIAMAccountPasswordPolicy(ctx context.Context, cfg aws.Config, fields map return values, nil } -func IAMAccessKey(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMAccessKey(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) usersPaginator := iam.NewListUsersPaginator(client, &iam.ListUsersInput{}) - var values []Resource + var values []models.Resource for usersPaginator.HasMorePages() { page, err := usersPaginator.NextPage(ctx) if err != nil { @@ -364,7 +365,7 @@ func IAMAccessKey(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func getIAMUserAccessKeys(ctx context.Context, cfg aws.Config, user types.User) ([]Resource, error) { +func getIAMUserAccessKeys(ctx context.Context, cfg aws.Config, user types.User) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) if user.UserName == nil { return nil, nil @@ -374,7 +375,7 @@ func getIAMUserAccessKeys(ctx context.Context, cfg aws.Config, user types.User) o.StopOnDuplicateToken = true }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -393,7 +394,7 @@ func getIAMUserAccessKeys(ctx context.Context, cfg aws.Config, user types.User) return values, nil } -func iAMAccessKeyHandle(ctx context.Context, cfg aws.Config, user types.User, v types.AccessKeyMetadata) (Resource, error) { +func iAMAccessKeyHandle(ctx context.Context, cfg aws.Config, user types.User, v types.AccessKeyMetadata) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := iam.NewFromConfig(cfg) lastUsed, err := client.GetAccessKeyLastUsed(ctx, &iam.GetAccessKeyLastUsedInput{ @@ -401,9 +402,9 @@ func iAMAccessKeyHandle(ctx context.Context, cfg aws.Config, user types.User, v }) if err != nil { if isErr(err, "GetAccessKeyLastUsedNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } username := describeCtx.AccountID if user.UserName != nil { @@ -414,7 +415,7 @@ func iAMAccessKeyHandle(ctx context.Context, cfg aws.Config, user types.User, v username = *user.UserId } arn := "arn:" + describeCtx.Partition + ":iam::" + describeCtx.AccountID + ":user/" + username + "/accesskey/" + *v.AccessKeyId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Description: model.IAMAccessKeyDescription{ @@ -432,10 +433,10 @@ func iAMAccessKeyHandle(ctx context.Context, cfg aws.Config, user types.User, v return resource, nil } -func IAMSSHPublicKey(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMSSHPublicKey(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) usersPaginator := iam.NewListUsersPaginator(client, &iam.ListUsersInput{}) - var values []Resource + var values []models.Resource for usersPaginator.HasMorePages() { page, err := usersPaginator.NextPage(ctx) if err != nil { @@ -460,7 +461,7 @@ func IAMSSHPublicKey(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func getIAMUserSSHPublicKeys(ctx context.Context, cfg aws.Config, user types.User) ([]Resource, error) { +func getIAMUserSSHPublicKeys(ctx context.Context, cfg aws.Config, user types.User) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) if user.UserName == nil { return nil, nil @@ -470,7 +471,7 @@ func getIAMUserSSHPublicKeys(ctx context.Context, cfg aws.Config, user types.Use o.StopOnDuplicateToken = true }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -489,7 +490,7 @@ func getIAMUserSSHPublicKeys(ctx context.Context, cfg aws.Config, user types.Use return values, nil } -func iAMSSHPublicKeyHandle(ctx context.Context, cfg aws.Config, user types.User, v types.SSHPublicKeyMetadata) (Resource, error) { +func iAMSSHPublicKeyHandle(ctx context.Context, cfg aws.Config, user types.User, v types.SSHPublicKeyMetadata) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) username := describeCtx.AccountID if user.UserName != nil { @@ -500,7 +501,7 @@ func iAMSSHPublicKeyHandle(ctx context.Context, cfg aws.Config, user types.User, username = *user.UserId } arn := "arn:" + describeCtx.Partition + ":iam::" + describeCtx.AccountID + ":user/" + username + "/sshpublickey/" + *v.SSHPublicKeyId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Description: model.IAMSSHPublicKeyDescription{ @@ -517,9 +518,9 @@ func iAMSSHPublicKeyHandle(ctx context.Context, cfg aws.Config, user types.User, return resource, nil } -func GetIAMAccessKey(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMAccessKey(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { userName := fields["name"] - var values []Resource + var values []models.Resource client := iam.NewFromConfig(cfg) accessKeys, err := client.ListAccessKeys(ctx, &iam.ListAccessKeysInput{ @@ -537,7 +538,7 @@ func GetIAMAccessKey(ctx context.Context, cfg aws.Config, fields map[string]stri if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -547,7 +548,7 @@ func GetIAMAccessKey(ctx context.Context, cfg aws.Config, fields map[string]stri return values, nil } -func IAMCredentialReport(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMCredentialReport(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := iam.NewFromConfig(cfg) output, err := client.GetCredentialReport(ctx, &iam.GetCredentialReportInput{}) @@ -578,10 +579,10 @@ func IAMCredentialReport(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - var values []Resource + var values []models.Resource for _, report := range reports { report.GeneratedTime = output.GeneratedTime - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: report.UserName, // Unique report entry per user Name: report.UserName + " Credential Report", @@ -602,14 +603,14 @@ func IAMCredentialReport(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func IAMPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) paginator := iam.NewListPoliciesPaginator(client, &iam.ListPoliciesInput{ OnlyAttached: true, Scope: types.PolicyScopeTypeAll, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -643,9 +644,9 @@ func IAMPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return values, nil } -func iAMPolicyHandle(ctx context.Context, v types.Policy, version *types.PolicyVersion) Resource { +func iAMPolicyHandle(ctx context.Context, v types.Policy, version *types.PolicyVersion) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.PolicyName, @@ -657,7 +658,7 @@ func iAMPolicyHandle(ctx context.Context, v types.Policy, version *types.PolicyV return resource } -func GetIAMPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] client := iam.NewFromConfig(cfg) out, err := client.GetPolicy(ctx, &iam.GetPolicyInput{PolicyArn: &arn}) @@ -666,7 +667,7 @@ func GetIAMPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) } v := out.Policy - var values []Resource + var values []models.Resource version, err := client.GetPolicyVersion(ctx, &iam.GetPolicyVersionInput{ PolicyArn: v.Arn, VersionId: v.DefaultVersionId, @@ -685,11 +686,11 @@ func GetIAMPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) return values, nil } -func IAMGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) paginator := iam.NewListGroupsPaginator(client, &iam.ListGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -738,9 +739,9 @@ func IAMGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func iAMGroupHandle(ctx context.Context, v types.Group, aPolicies []string, policies []model.InlinePolicy, users []types.User) Resource { +func iAMGroupHandle(ctx context.Context, v types.Group, aPolicies []string, policies []model.InlinePolicy, users []types.User) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.GroupName, @@ -754,8 +755,8 @@ func iAMGroupHandle(ctx context.Context, v types.Group, aPolicies []string, poli return resource } -func GetIAMGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetIAMGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource groupName := fields["name"] client := iam.NewFromConfig(cfg) groupOut, err := client.GetGroup(ctx, &iam.GetGroupInput{ @@ -868,12 +869,12 @@ func getGroupAttachedPolicyArns(ctx context.Context, client *iam.Client, groupna return arns, nil } -func IAMInstanceProfile(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMInstanceProfile(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := iam.NewFromConfig(cfg) paginator := iam.NewListInstanceProfilesPaginator(client, &iam.ListInstanceProfilesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -881,7 +882,7 @@ func IAMInstanceProfile(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, v := range page.InstanceProfiles { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.InstanceProfileName, @@ -900,14 +901,14 @@ func IAMInstanceProfile(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func IAMManagedPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMManagedPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := iam.NewFromConfig(cfg) paginator := iam.NewListPoliciesPaginator(client, &iam.ListPoliciesInput{ OnlyAttached: true, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -915,7 +916,7 @@ func IAMManagedPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) } for _, v := range page.Policies { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.PolicyName, @@ -934,7 +935,7 @@ func IAMManagedPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func IAMOIDCProvider(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMOIDCProvider(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := iam.NewFromConfig(cfg) output, err := client.ListOpenIDConnectProviders(ctx, &iam.ListOpenIDConnectProvidersInput{}) @@ -942,9 +943,9 @@ func IAMOIDCProvider(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.OpenIDConnectProviderList { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Arn, @@ -962,7 +963,7 @@ func IAMOIDCProvider(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func IAMGroupPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMGroupPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) groups, err := IAMGroup(ctx, cfg, nil) if err != nil { @@ -971,7 +972,7 @@ func IAMGroupPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ( client := iam.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, g := range groups { group := g.Description.(model.IAMGroupDescription).Group err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { @@ -992,7 +993,7 @@ func IAMGroupPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*v.GroupName, *v.PolicyName), Name: *v.GroupName, @@ -1018,7 +1019,7 @@ func IAMGroupPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func IAMUserPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMUserPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) users, err := IAMUser(ctx, cfg, nil) if err != nil { @@ -1027,7 +1028,7 @@ func IAMUserPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ client := iam.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, u := range users { user := u.Description.(model.IAMUserDescription).User err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { @@ -1048,7 +1049,7 @@ func IAMUserPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*v.UserName, *v.PolicyName), Name: *v.UserName, @@ -1073,7 +1074,7 @@ func IAMUserPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func IAMRolePolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMRolePolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) roles, err := IAMRole(ctx, cfg, nil) if err != nil { @@ -1082,7 +1083,7 @@ func IAMRolePolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ client := iam.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, r := range roles { role := r.Description.(model.IAMRoleDescription).Role @@ -1104,7 +1105,7 @@ func IAMRolePolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*v.RoleName, *v.PolicyName), Name: *v.RoleName, @@ -1129,11 +1130,11 @@ func IAMRolePolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func IAMRole(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMRole(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) paginator := iam.NewListRolesPaginator(client, &iam.ListRolesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1159,7 +1160,7 @@ func IAMRole(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou } return values, nil } -func iAMRoleHandle(ctx context.Context, client *iam.Client, v types.Role) (*Resource, error) { +func iAMRoleHandle(ctx context.Context, client *iam.Client, v types.Role) (*models.Resource, error) { describeCtx := GetDescribeContext(ctx) role, err := client.GetRole(ctx, &iam.GetRoleInput{ @@ -1188,7 +1189,7 @@ func iAMRoleHandle(ctx context.Context, client *iam.Client, v types.Role) (*Reso return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.RoleName, @@ -1201,7 +1202,7 @@ func iAMRoleHandle(ctx context.Context, client *iam.Client, v types.Role) (*Reso } return &resource, nil } -func GetIAMRole(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMRole(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { pathPrefix := fields["path"] client := iam.NewFromConfig(cfg) @@ -1214,7 +1215,7 @@ func GetIAMRole(ctx context.Context, cfg aws.Config, fields map[string]string) ( return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Roles { resource, err := iAMRoleHandle(ctx, client, v) if err != nil { @@ -1300,11 +1301,11 @@ func getRoleAttachedPolicyArns(ctx context.Context, client *iam.Client, rolename return arns, nil } -func IAMServerCertificate(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMServerCertificate(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) paginator := iam.NewListServerCertificatesPaginator(client, &iam.ListServerCertificatesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1334,7 +1335,7 @@ func IAMServerCertificate(ctx context.Context, cfg aws.Config, stream *StreamSen } return values, nil } -func iAMServerCertificateHandle(ctx context.Context, v types.ServerCertificateMetadata, output *iam.GetServerCertificateOutput) (*Resource, error) { +func iAMServerCertificateHandle(ctx context.Context, v types.ServerCertificateMetadata, output *iam.GetServerCertificateOutput) (*models.Resource, error) { describeCtx := GetDescribeContext(ctx) var bodyLength int @@ -1347,7 +1348,7 @@ func iAMServerCertificateHandle(ctx context.Context, v types.ServerCertificateMe bodyLength = cert.PublicKey.(*rsa.PublicKey).N.BitLen() } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.ServerCertificateName, @@ -1358,8 +1359,8 @@ func iAMServerCertificateHandle(ctx context.Context, v types.ServerCertificateMe } return &resource, nil } -func GetIAMServerCertificate(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetIAMServerCertificate(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource pathPerfix := fields["path"] client := iam.NewFromConfig(cfg) @@ -1393,11 +1394,11 @@ func GetIAMServerCertificate(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func IAMUser(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMUser(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) paginator := iam.NewListUsersPaginator(client, &iam.ListUsersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1409,7 +1410,7 @@ func IAMUser(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -1427,34 +1428,34 @@ func IAMUser(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou return values, nil } -func iAMUserHandle(ctx context.Context, cfg aws.Config, v types.User) (Resource, error) { +func iAMUserHandle(ctx context.Context, cfg aws.Config, v types.User) (models.Resource, error) { client := iam.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) policies, err := getUserPolicies(ctx, client, v.UserName) if err != nil { if !isErr(err, "GetLoginProfileNotFound") && !isErr(err, "InvalidParameterValue") && !isErr(err, "NoSuchEntity") { - return Resource{}, err + return models.Resource{}, err } } aPolicies, err := getUserAttachedPolicyArns(ctx, client, v.UserName) if err != nil { if !isErr(err, "GetLoginProfileNotFound") && !isErr(err, "InvalidParameterValue") && !isErr(err, "NoSuchEntity") { - return Resource{}, err + return models.Resource{}, err } } groups, err := getUserGroups(ctx, client, v.UserName) if err != nil { if !isErr(err, "GetLoginProfileNotFound") && !isErr(err, "InvalidParameterValue") && !isErr(err, "NoSuchEntity") { - return Resource{}, err + return models.Resource{}, err } } devices, err := getUserMFADevices(ctx, client, v.UserName) if err != nil { if !isErr(err, "GetLoginProfileNotFound") && !isErr(err, "InvalidParameterValue") && !isErr(err, "NoSuchEntity") { - return Resource{}, err + return models.Resource{}, err } } @@ -1464,13 +1465,13 @@ func iAMUserHandle(ctx context.Context, cfg aws.Config, v types.User) (Resource, }) if err != nil { if !isErr(err, "GetLoginProfileNotFound") && !isErr(err, "InvalidParameterValue") && !isErr(err, "NoSuchEntity") { - return Resource{}, err + return models.Resource{}, err } } else { loginProfile = *getLoginProfile.LoginProfile } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.UserName, @@ -1485,7 +1486,7 @@ func iAMUserHandle(ctx context.Context, cfg aws.Config, v types.User) (Resource, } return resource, nil } -func GetIAMUser(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMUser(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { userName := fields["name"] client := iam.NewFromConfig(cfg) @@ -1496,13 +1497,13 @@ func GetIAMUser(ctx context.Context, cfg aws.Config, fields map[string]string) ( return nil, err } - var values []Resource + var values []models.Resource resource, err := iAMUserHandle(ctx, cfg, *out.User) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -1512,7 +1513,7 @@ func GetIAMUser(ctx context.Context, cfg aws.Config, fields map[string]string) ( return values, nil } -func IAMPolicyAttachment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMPolicyAttachment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := iam.NewFromConfig(cfg) paginator := iam.NewListPoliciesPaginator(client, &iam.ListPoliciesInput{ @@ -1520,7 +1521,7 @@ func IAMPolicyAttachment(ctx context.Context, cfg aws.Config, stream *StreamSend Scope: types.PolicyScopeTypeAll, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1545,7 +1546,7 @@ func IAMPolicyAttachment(ctx context.Context, cfg aws.Config, stream *StreamSend policyRoles = append(policyRoles, attachmentPage.PolicyRoles...) policyUsers = append(policyUsers, attachmentPage.PolicyUsers...) } - resource := Resource{ + resource := models.Resource{ ARN: *policy.Arn, Region: describeCtx.OGRegion, Name: fmt.Sprintf("%s - Attachments", *policy.Arn), @@ -1571,9 +1572,9 @@ func IAMPolicyAttachment(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func iAMPolicyAttachmentHandle(ctx context.Context, policy types.Policy, policyGroups []types.PolicyGroup, policyRoles []types.PolicyRole, policyUsers []types.PolicyUser) Resource { +func iAMPolicyAttachmentHandle(ctx context.Context, policy types.Policy, policyGroups []types.PolicyGroup, policyRoles []types.PolicyRole, policyUsers []types.PolicyUser) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: fmt.Sprintf("%s - Attachments", *policy.Arn), Description: model.IAMPolicyAttachmentDescription{ @@ -1587,7 +1588,7 @@ func iAMPolicyAttachmentHandle(ctx context.Context, policy types.Policy, policyG } return resource } -func GetIAMPolicyAttachment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMPolicyAttachment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) policyARN := fields["arn"] policy, err := client.GetPolicy(ctx, &iam.GetPolicyInput{PolicyArn: &policyARN}) @@ -1595,7 +1596,7 @@ func GetIAMPolicyAttachment(ctx context.Context, cfg aws.Config, fields map[stri return nil, err } - var values []Resource + var values []models.Resource attachmentPaginator := iam.NewListEntitiesForPolicyPaginator(client, &iam.ListEntitiesForPolicyInput{ PolicyArn: &policyARN, }) @@ -1618,14 +1619,14 @@ func GetIAMPolicyAttachment(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func IAMSamlProvider(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMSamlProvider(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) output, err := client.ListSAMLProviders(ctx, &iam.ListSAMLProvidersInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.SAMLProviderList { samlProvider, err := client.GetSAMLProvider(ctx, &iam.GetSAMLProviderInput{ SAMLProviderArn: v.Arn, @@ -1649,9 +1650,9 @@ func IAMSamlProvider(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func iAMSamlProviderHandle(ctx context.Context, samlProvider *iam.GetSAMLProviderOutput, Arn string) Resource { +func iAMSamlProviderHandle(ctx context.Context, samlProvider *iam.GetSAMLProviderOutput, Arn string) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: Arn, Description: model.IAMSamlProviderDescription{ @@ -1660,9 +1661,9 @@ func iAMSamlProviderHandle(ctx context.Context, samlProvider *iam.GetSAMLProvide } return resource } -func GetIAMSamlProvider(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMSamlProvider(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { samlProviderArn := fields["samlProviderArn"] - var values []Resource + var values []models.Resource client := iam.NewFromConfig(cfg) samlProvider, err := client.GetSAMLProvider(ctx, &iam.GetSAMLProviderInput{ @@ -1680,11 +1681,11 @@ func GetIAMSamlProvider(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func IAMServiceSpecificCredential(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMServiceSpecificCredential(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) paginator := iam.NewListUsersPaginator(client, &iam.ListUsersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1714,9 +1715,9 @@ func IAMServiceSpecificCredential(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func iAMServiceSpecificCredentialHandle(ctx context.Context, credential types.ServiceSpecificCredentialMetadata) Resource { +func iAMServiceSpecificCredentialHandle(ctx context.Context, credential types.ServiceSpecificCredentialMetadata) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *credential.ServiceSpecificCredentialId, Description: model.IAMServiceSpecificCredentialDescription{ @@ -1725,9 +1726,9 @@ func iAMServiceSpecificCredentialHandle(ctx context.Context, credential types.Se } return resource } -func GetIAMServiceSpecificCredential(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMServiceSpecificCredential(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { UserName := fields["userName"] - var values []Resource + var values []models.Resource client := iam.NewFromConfig(cfg) serviceSpecificCredentials, err := client.ListServiceSpecificCredentials(ctx, &iam.ListServiceSpecificCredentialsInput{ @@ -1832,14 +1833,14 @@ func getUserMFADevices(ctx context.Context, client *iam.Client, username *string return devices, nil } -func IAMVirtualMFADevice(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMVirtualMFADevice(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) output, err := client.ListVirtualMFADevices(ctx, &iam.ListVirtualMFADevicesInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.VirtualMFADevices { output, err := client.ListMFADeviceTags(ctx, &iam.ListMFADeviceTagsInput{ SerialNumber: v.SerialNumber, @@ -1860,9 +1861,9 @@ func IAMVirtualMFADevice(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func iAMVirtualMFADeviceHandle(ctx context.Context, v types.VirtualMFADevice, output *iam.ListMFADeviceTagsOutput) Resource { +func iAMVirtualMFADeviceHandle(ctx context.Context, v types.VirtualMFADevice, output *iam.ListMFADeviceTagsOutput) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.SerialNumber, Name: *v.SerialNumber, @@ -1873,7 +1874,7 @@ func iAMVirtualMFADeviceHandle(ctx context.Context, v types.VirtualMFADevice, ou } return resource } -func GetIAMVirtualMFADevice(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMVirtualMFADevice(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) SerialNumber := fields["serialNumber"] output, err := client.ListVirtualMFADevices(ctx, &iam.ListVirtualMFADevicesInput{}) @@ -1884,7 +1885,7 @@ func GetIAMVirtualMFADevice(ctx context.Context, cfg aws.Config, fields map[stri return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.VirtualMFADevices { if *v.SerialNumber != SerialNumber { continue @@ -1903,12 +1904,12 @@ func GetIAMVirtualMFADevice(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func IAMOpenIdConnectProvider(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IAMOpenIdConnectProvider(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := iam.NewFromConfig(cfg) // SDK doesn't have new paginator for ListOpenIDConnectProviders action output, err := client.ListOpenIDConnectProviders(ctx, &iam.ListOpenIDConnectProvidersInput{}) - var values []Resource + var values []models.Resource if err != nil { return nil, err } @@ -1927,7 +1928,7 @@ func IAMOpenIdConnectProvider(ctx context.Context, cfg aws.Config, stream *Strea } return values, nil } -func iAMOpenIdConnectProviderHandle(ctx context.Context, cfg aws.Config, arn string) (Resource, error) { +func iAMOpenIdConnectProviderHandle(ctx context.Context, cfg aws.Config, arn string) (models.Resource, error) { client := iam.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) params := &iam.GetOpenIDConnectProviderInput{ @@ -1936,10 +1937,10 @@ func iAMOpenIdConnectProviderHandle(ctx context.Context, cfg aws.Config, arn str op, err := client.GetOpenIDConnectProvider(ctx, params) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Description: model.IAMOpenIdConnectProviderDescription{ @@ -1952,9 +1953,9 @@ func iAMOpenIdConnectProviderHandle(ctx context.Context, cfg aws.Config, arn str } return resource, nil } -func GetIAMOpenIdConnectProvider(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetIAMOpenIdConnectProvider(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] - var values []Resource + var values []models.Resource resource, err := iAMOpenIdConnectProviderHandle(ctx, cfg, arn) if err != nil { return nil, err diff --git a/provider/describer/identitystore.go b/provider/describer/identitystore.go index 55c93fc1..ce8b4663 100755 --- a/provider/describer/identitystore.go +++ b/provider/describer/identitystore.go @@ -4,19 +4,20 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/ssoadmin" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/identitystore" "github.com/opengovern/og-describer-aws/provider/model" ) -func IdentityStoreGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IdentityStoreGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := identitystore.NewFromConfig(cfg) ssoadminClient := ssoadmin.NewFromConfig(cfg) paginator := ssoadmin.NewListInstancesPaginator(ssoadminClient, &ssoadmin.ListInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -31,7 +32,7 @@ func IdentityStoreGroup(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, group := range page2.Groups { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *group.GroupId, Name: *group.DisplayName, @@ -54,13 +55,13 @@ func IdentityStoreGroup(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func IdentityStoreUser(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IdentityStoreUser(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := identitystore.NewFromConfig(cfg) ssoadminClient := ssoadmin.NewFromConfig(cfg) paginator := ssoadmin.NewListInstancesPaginator(ssoadminClient, &ssoadmin.ListInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -79,7 +80,7 @@ func IdentityStoreUser(ctx context.Context, cfg aws.Config, stream *StreamSender primaryEmail = e.Value } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *user.UserId, Name: *user.UserName, @@ -102,14 +103,14 @@ func IdentityStoreUser(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func IdentityStoreGroupMembership(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func IdentityStoreGroupMembership(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := identitystore.NewFromConfig(cfg) ssoadminClient := ssoadmin.NewFromConfig(cfg) paginator := ssoadmin.NewListInstancesPaginator(ssoadminClient, &ssoadmin.ListInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -133,7 +134,7 @@ func IdentityStoreGroupMembership(ctx context.Context, cfg aws.Config, stream *S return nil, err } for _, membership := range membershipPage.GroupMemberships { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *membership.MembershipId, Description: model.IdentityStoreGroupMembershipDescription{ diff --git a/provider/describer/imagebuilder.go b/provider/describer/imagebuilder.go index 03b815e1..a064b3f4 100755 --- a/provider/describer/imagebuilder.go +++ b/provider/describer/imagebuilder.go @@ -4,17 +4,18 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/imagebuilder" "github.com/opengovern/og-describer-aws/provider/model" ) -func ImageBuilderImage(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ImageBuilderImage(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := imagebuilder.NewFromConfig(cfg) paginator := imagebuilder.NewListImagesPaginator(client, &imagebuilder.ListImagesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -33,7 +34,7 @@ func ImageBuilderImage(ctx context.Context, cfg aws.Config, stream *StreamSender for _, imageSummary := range buildVersionPage.ImageSummaryList { resource, err := imageBuilderImageHandle(ctx, cfg, imageSummary) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -55,7 +56,7 @@ func ImageBuilderImage(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func imageBuilderImageHandle(ctx context.Context, cfg aws.Config, imageSummary types.ImageSummary) (Resource, error) { +func imageBuilderImageHandle(ctx context.Context, cfg aws.Config, imageSummary types.ImageSummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := imagebuilder.NewFromConfig(cfg) image, err := client.GetImage(ctx, &imagebuilder.GetImageInput{ @@ -63,12 +64,12 @@ func imageBuilderImageHandle(ctx context.Context, cfg aws.Config, imageSummary t }) if err != nil { if isErr(err, "GetImageNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *image.Image.Arn, Name: *image.Image.Name, @@ -78,7 +79,7 @@ func imageBuilderImageHandle(ctx context.Context, cfg aws.Config, imageSummary t } return resource, nil } -func GetImageBuilderImage(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetImageBuilderImage(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] client := imagebuilder.NewFromConfig(cfg) out, err := client.ListImageBuildVersions(ctx, &imagebuilder.ListImageBuildVersionsInput{ @@ -90,11 +91,11 @@ func GetImageBuilderImage(ctx context.Context, cfg aws.Config, fields map[string } return nil, err } - var values []Resource + var values []models.Resource for _, imageSummery := range out.ImageSummaryList { resource, err := imageBuilderImageHandle(ctx, cfg, imageSummery) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/inspector.go b/provider/describer/inspector.go index 30ecd002..f65efdab 100755 --- a/provider/describer/inspector.go +++ b/provider/describer/inspector.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "reflect" "github.com/aws/aws-sdk-go-v2/service/inspector/types" @@ -12,12 +13,12 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func InspectorAssessmentRun(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func InspectorAssessmentRun(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := inspector.NewFromConfig(cfg) paginator := inspector.NewListAssessmentRunsPaginator(client, &inspector.ListAssessmentRunsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -36,7 +37,7 @@ func InspectorAssessmentRun(ctx context.Context, cfg aws.Config, stream *StreamS } for _, assessmentRun := range assessmentRuns.AssessmentRuns { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *assessmentRun.Name, ARN: *assessmentRun.Arn, @@ -57,11 +58,11 @@ func InspectorAssessmentRun(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func InspectorAssessmentTarget(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func InspectorAssessmentTarget(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := inspector.NewFromConfig(cfg) paginator := inspector.NewListAssessmentTargetsPaginator(client, &inspector.ListAssessmentTargetsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -92,9 +93,9 @@ func InspectorAssessmentTarget(ctx context.Context, cfg aws.Config, stream *Stre } return values, nil } -func inspectorAssessmentTargetHandle(ctx context.Context, assessmentTarget types.AssessmentTarget) Resource { +func inspectorAssessmentTargetHandle(ctx context.Context, assessmentTarget types.AssessmentTarget) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *assessmentTarget.Name, ARN: *assessmentTarget.Arn, @@ -104,9 +105,9 @@ func inspectorAssessmentTargetHandle(ctx context.Context, assessmentTarget types } return resource } -func GetInspectorAssessmentTarget(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetInspectorAssessmentTarget(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { AssessmentTargetArn := fields["arn"] - var values []Resource + var values []models.Resource client := inspector.NewFromConfig(cfg) describeAssessments, err := client.DescribeAssessmentTargets(ctx, &inspector.DescribeAssessmentTargetsInput{ @@ -126,11 +127,11 @@ func GetInspectorAssessmentTarget(ctx context.Context, cfg aws.Config, fields ma return values, nil } -func InspectorAssessmentTemplate(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func InspectorAssessmentTemplate(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := inspector.NewFromConfig(cfg) paginator := inspector.NewListAssessmentTemplatesPaginator(client, &inspector.ListAssessmentTemplatesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -176,9 +177,9 @@ func InspectorAssessmentTemplate(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func inspectorAssessmentTemplateHandle(ctx context.Context, assessmentTemplate types.AssessmentTemplate, eventSubscriptions *inspector.ListEventSubscriptionsOutput, tags *inspector.ListTagsForResourceOutput) Resource { +func inspectorAssessmentTemplateHandle(ctx context.Context, assessmentTemplate types.AssessmentTemplate, eventSubscriptions *inspector.ListEventSubscriptionsOutput, tags *inspector.ListTagsForResourceOutput) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *assessmentTemplate.Name, ARN: *assessmentTemplate.Arn, @@ -190,11 +191,11 @@ func inspectorAssessmentTemplateHandle(ctx context.Context, assessmentTemplate t } return resource } -func GetInspectorAssessmentTemplate(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetInspectorAssessmentTemplate(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] client := inspector.NewFromConfig(cfg) - var values []Resource + var values []models.Resource assessmentTemplates, err := client.DescribeAssessmentTemplates(ctx, &inspector.DescribeAssessmentTemplatesInput{ AssessmentTemplateArns: []string{arn}, }) @@ -223,12 +224,12 @@ func GetInspectorAssessmentTemplate(ctx context.Context, cfg aws.Config, fields return values, nil } -func InspectorExclusion(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func InspectorExclusion(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := inspector.NewFromConfig(cfg) paginator := inspector.NewListAssessmentRunsPaginator(client, &inspector.ListAssessmentRunsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -254,7 +255,7 @@ func InspectorExclusion(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, exclusion := range exclusions.Exclusions { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *exclusion.Title, ARN: *exclusion.Arn, @@ -276,12 +277,12 @@ func InspectorExclusion(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func InspectorFinding(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func InspectorFinding(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := inspector.NewFromConfig(cfg) paginator := inspector.NewListFindingsPaginator(client, &inspector.ListFindingsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -300,7 +301,7 @@ func InspectorFinding(ctx context.Context, cfg aws.Config, stream *StreamSender) } for _, finding := range findings.Findings { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *finding.Title, ID: *finding.Id, @@ -323,12 +324,12 @@ func InspectorFinding(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func Inspector2Coverage(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Inspector2Coverage(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := inspector2.NewFromConfig(cfg) paginator := inspector2.NewListCoveragePaginator(client, &inspector2.ListCoverageInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -336,7 +337,7 @@ func Inspector2Coverage(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, coveredResource := range page.CoveredResources { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *coveredResource.ResourceId, Description: model.Inspector2CoverageDescription{ @@ -356,18 +357,18 @@ func Inspector2Coverage(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func Inspector2CoverageStatistic(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Inspector2CoverageStatistic(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := inspector2.NewFromConfig(cfg) paginator := inspector2.NewListCoverageStatisticsPaginator(client, &inspector2.ListCoverageStatisticsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.Inspector2CoverageStatisticDescription{ TotalCounts: page.TotalCounts, @@ -386,7 +387,7 @@ func Inspector2CoverageStatistic(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func Inspector2CoverageMember(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Inspector2CoverageMember(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := inspector2.NewFromConfig(cfg) associated, err := Inspector2CoverageMemberHelper(ctx, cfg, client, true) if err != nil { @@ -396,7 +397,7 @@ func Inspector2CoverageMember(ctx context.Context, cfg aws.Config, stream *Strea if err != nil { return nil, err } - var values []Resource + var values []models.Resource values = append(values, associated...) for _, resource := range notAssociated { if !ContainsResource(resource, values) { @@ -406,7 +407,7 @@ func Inspector2CoverageMember(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func ContainsResource(val Resource, values []Resource) bool { +func ContainsResource(val models.Resource, values []models.Resource) bool { for _, v := range values { if reflect.DeepEqual(val, v) { return true @@ -415,21 +416,21 @@ func ContainsResource(val Resource, values []Resource) bool { return false } -func Inspector2CoverageMemberHelper(ctx context.Context, cfg aws.Config, client *inspector2.Client, onlyAssociated bool) ([]Resource, error) { +func Inspector2CoverageMemberHelper(ctx context.Context, cfg aws.Config, client *inspector2.Client, onlyAssociated bool) ([]models.Resource, error) { input := &inspector2.ListMembersInput{ OnlyAssociated: &onlyAssociated, } paginator := inspector2.NewListMembersPaginator(client, input) describeCtx := GetDescribeContext(ctx) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } for _, member := range page.Members { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.Inspector2MemberDescription{ Member: member, @@ -444,12 +445,12 @@ func Inspector2CoverageMemberHelper(ctx context.Context, cfg aws.Config, client return values, nil } -func Inspector2Finding(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Inspector2Finding(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := inspector2.NewFromConfig(cfg) paginator := inspector2.NewListFindingsPaginator(client, &inspector2.ListFindingsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) for _, finding := range page.Findings { @@ -457,7 +458,7 @@ func Inspector2Finding(ctx context.Context, cfg aws.Config, stream *StreamSender return nil, err } for _, v := range finding.Resources { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.Inspector2FindingDescription{ Finding: finding, diff --git a/provider/describer/kafka.go b/provider/describer/kafka.go index 6a493af6..d882d79c 100755 --- a/provider/describer/kafka.go +++ b/provider/describer/kafka.go @@ -4,17 +4,18 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/kafka/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/kafka" "github.com/opengovern/og-describer-aws/provider/model" ) -func KafkaCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func KafkaCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := kafka.NewFromConfig(cfg) paginator := kafka.NewListClustersV2Paginator(client, &kafka.ListClustersV2Input{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -23,7 +24,7 @@ func KafkaCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] for _, cluster := range page.ClusterInfoList { resource, err := kafkaClusterHandle(ctx, cfg, cluster) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -43,7 +44,7 @@ func KafkaCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func kafkaClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Cluster) (Resource, error) { +func kafkaClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Cluster) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := kafka.NewFromConfig(cfg) @@ -61,9 +62,9 @@ func kafkaClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Clust configOut, err = client.DescribeConfiguration(ctx, &kafka.DescribeConfigurationInput{Arn: &configArn}) if err != nil { if isErr(err, "DescribeConfigurationNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } } @@ -73,13 +74,13 @@ func kafkaClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Clust }) if err != nil { if isErr(err, "DescribeClusterOperationNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } operationInfo = op.ClusterOperationInfo } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *cluster.ClusterArn, Name: *cluster.ClusterName, @@ -91,9 +92,9 @@ func kafkaClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Clust } return resource, nil } -func GetKafkaCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetKafkaCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterName := fields["nameCluster"] - var values []Resource + var values []models.Resource client := kafka.NewFromConfig(cfg) out, err := client.ListClustersV2(ctx, &kafka.ListClustersV2Input{ @@ -112,7 +113,7 @@ func GetKafkaCluster(ctx context.Context, cfg aws.Config, fields map[string]stri } resource, err := kafkaClusterHandle(ctx, cfg, cluster) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/keyspaces.go b/provider/describer/keyspaces.go index 08445cb6..bfc344d0 100755 --- a/provider/describer/keyspaces.go +++ b/provider/describer/keyspaces.go @@ -3,6 +3,7 @@ package describer import ( "context" _ "database/sql/driver" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/service/keyspaces/types" @@ -11,11 +12,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func KeyspacesKeyspace(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func KeyspacesKeyspace(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := keyspaces.NewFromConfig(cfg) paginator := keyspaces.NewListKeyspacesPaginator(client, &keyspaces.ListKeyspacesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -24,7 +25,7 @@ func KeyspacesKeyspace(ctx context.Context, cfg aws.Config, stream *StreamSender for _, v := range page.Keyspaces { resource, err := keyspacesKeyspaceHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -44,7 +45,7 @@ func KeyspacesKeyspace(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func keyspacesKeyspaceHandle(ctx context.Context, cfg aws.Config, v types.KeyspaceSummary) (Resource, error) { +func keyspacesKeyspaceHandle(ctx context.Context, cfg aws.Config, v types.KeyspaceSummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := keyspaces.NewFromConfig(cfg) @@ -53,12 +54,12 @@ func keyspacesKeyspaceHandle(ctx context.Context, cfg aws.Config, v types.Keyspa }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ResourceArn, Name: *v.KeyspaceName, @@ -69,9 +70,9 @@ func keyspacesKeyspaceHandle(ctx context.Context, cfg aws.Config, v types.Keyspa } return resource, nil } -func GetKeyspacesKeyspace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetKeyspacesKeyspace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["name"] - var values []Resource + var values []models.Resource client := keyspaces.NewFromConfig(cfg) out, err := client.GetKeyspace(ctx, &keyspaces.GetKeyspaceInput{ KeyspaceName: &name, @@ -89,7 +90,7 @@ func GetKeyspacesKeyspace(ctx context.Context, cfg aws.Config, fields map[string } resource, err := keyspacesKeyspaceHandle(ctx, cfg, keyspace) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -101,11 +102,11 @@ func GetKeyspacesKeyspace(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func KeyspacesTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func KeyspacesTable(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := keyspaces.NewFromConfig(cfg) keyspacePaginator := keyspaces.NewListKeyspacesPaginator(client, &keyspaces.ListKeyspacesInput{}) - var values []Resource + var values []models.Resource for keyspacePaginator.HasMorePages() { keyspacePage, err := keyspacePaginator.NextPage(ctx) if err != nil { @@ -125,7 +126,7 @@ func KeyspacesTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ( for _, v := range page.Tables { resource, err := keyspacesTableHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -147,7 +148,7 @@ func KeyspacesTable(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func keyspacesTableHandle(ctx context.Context, cfg aws.Config, v types.TableSummary) (Resource, error) { +func keyspacesTableHandle(ctx context.Context, cfg aws.Config, v types.TableSummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := keyspaces.NewFromConfig(cfg) @@ -156,12 +157,12 @@ func keyspacesTableHandle(ctx context.Context, cfg aws.Config, v types.TableSumm }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ResourceArn, Name: *v.KeyspaceName, @@ -172,8 +173,8 @@ func keyspacesTableHandle(ctx context.Context, cfg aws.Config, v types.TableSumm } return resource, nil } -func GetKeyspacesTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetKeyspacesTable(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource name := fields["name"] client := keyspaces.NewFromConfig(cfg) @@ -189,7 +190,7 @@ func GetKeyspacesTable(ctx context.Context, cfg aws.Config, fields map[string]st for _, v := range list.Tables { resource, err := keyspacesTableHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/kinesis.go b/provider/describer/kinesis.go index de4650fa..f6120d99 100755 --- a/provider/describer/kinesis.go +++ b/provider/describer/kinesis.go @@ -4,6 +4,7 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/kinesis/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/kinesis" @@ -12,10 +13,10 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func KinesisStream(ctx context.Context, cfg aws.Config, streamS *StreamSender) ([]Resource, error) { +func KinesisStream(ctx context.Context, cfg aws.Config, streamS *models.StreamSender) ([]models.Resource, error) { client := kinesis.NewFromConfig(cfg) - var values []Resource + var values []models.Resource var lastStreamName *string = nil for { streams, err := client.ListStreams(ctx, &kinesis.ListStreamsInput{ @@ -78,9 +79,9 @@ func KinesisStream(ctx context.Context, cfg aws.Config, streamS *StreamSender) ( return values, nil } -func kinesisStreamHandle(ctx context.Context, stream *kinesis.DescribeStreamOutput, streamSummery *kinesis.DescribeStreamSummaryOutput, tags *kinesis.ListTagsForStreamOutput) Resource { +func kinesisStreamHandle(ctx context.Context, stream *kinesis.DescribeStreamOutput, streamSummery *kinesis.DescribeStreamSummaryOutput, tags *kinesis.ListTagsForStreamOutput) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *stream.StreamDescription.StreamARN, Name: *stream.StreamDescription.StreamName, @@ -92,10 +93,10 @@ func kinesisStreamHandle(ctx context.Context, stream *kinesis.DescribeStreamOutp } return resource } -func GetKinesisStream(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetKinesisStream(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { streamName := fields["name"] - var values []Resource + var values []models.Resource client := kinesis.NewFromConfig(cfg) stream, err := client.DescribeStream(ctx, &kinesis.DescribeStreamInput{ StreamName: &streamName, @@ -131,9 +132,9 @@ func GetKinesisStream(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func KinesisConsumer(ctx context.Context, cfg aws.Config, streamS *StreamSender) ([]Resource, error) { +func KinesisConsumer(ctx context.Context, cfg aws.Config, streamS *models.StreamSender) ([]models.Resource, error) { client := kinesis.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(startName *string) (*string, error) { streams, err := client.ListStreams(ctx, &kinesis.ListStreamsInput{ ExclusiveStartStreamName: startName, @@ -192,9 +193,9 @@ func KinesisConsumer(ctx context.Context, cfg aws.Config, streamS *StreamSender) return values, nil } -func kinesisConsumerHandle(ctx context.Context, stream *kinesis.DescribeStreamOutput, consumer types.Consumer) Resource { +func kinesisConsumerHandle(ctx context.Context, stream *kinesis.DescribeStreamOutput, consumer types.Consumer) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *consumer.ConsumerARN, Name: *consumer.ConsumerName, @@ -205,9 +206,9 @@ func kinesisConsumerHandle(ctx context.Context, stream *kinesis.DescribeStreamOu } return resource } -func GetKinesisConsumer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetKinesisConsumer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { streamName := fields["name"] - var values []Resource + var values []models.Resource client := kinesis.NewFromConfig(cfg) stream, err := client.DescribeStream(ctx, &kinesis.DescribeStreamInput{ StreamName: &streamName, @@ -236,11 +237,11 @@ func GetKinesisConsumer(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func KinesisVideoStream(ctx context.Context, cfg aws.Config, streamS *StreamSender) ([]Resource, error) { +func KinesisVideoStream(ctx context.Context, cfg aws.Config, streamS *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := kinesisvideo.NewFromConfig(cfg) paginator := kinesisvideo.NewListStreamsPaginator(client, &kinesisvideo.ListStreamsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -254,7 +255,7 @@ func KinesisVideoStream(ctx context.Context, cfg aws.Config, streamS *StreamSend tags = &kinesisvideo.ListTagsForStreamOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *stream.StreamARN, Name: *stream.StreamName, @@ -276,9 +277,9 @@ func KinesisVideoStream(ctx context.Context, cfg aws.Config, streamS *StreamSend return values, nil } -func KinesisAnalyticsV2Application(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func KinesisAnalyticsV2Application(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := kinesisanalyticsv2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (*string, error) { applications, err := client.ListApplications(ctx, &kinesisanalyticsv2.ListApplicationsInput{ @@ -322,9 +323,9 @@ func KinesisAnalyticsV2Application(ctx context.Context, cfg aws.Config, stream * return values, nil } -func kinesisAnalyticsV2ApplicationHandle(ctx context.Context, description *kinesisanalyticsv2.DescribeApplicationOutput, tags *kinesisanalyticsv2.ListTagsForResourceOutput) Resource { +func kinesisAnalyticsV2ApplicationHandle(ctx context.Context, description *kinesisanalyticsv2.DescribeApplicationOutput, tags *kinesisanalyticsv2.ListTagsForResourceOutput) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *description.ApplicationDetail.ApplicationARN, Name: *description.ApplicationDetail.ApplicationName, @@ -335,10 +336,10 @@ func kinesisAnalyticsV2ApplicationHandle(ctx context.Context, description *kines } return resource } -func GetKinesisAnalyticsV2Application(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetKinesisAnalyticsV2Application(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { applicationName := fields["name"] - var values []Resource + var values []models.Resource client := kinesisanalyticsv2.NewFromConfig(cfg) description, err := client.DescribeApplication(ctx, &kinesisanalyticsv2.DescribeApplicationInput{ ApplicationName: &applicationName, diff --git a/provider/describer/kms.go b/provider/describer/kms.go index 16c310d7..4f6796e5 100755 --- a/provider/describer/kms.go +++ b/provider/describer/kms.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/aws/smithy-go" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/turbot/go-kit/helpers" @@ -16,11 +17,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func KMSAlias(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func KMSAlias(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := kms.NewFromConfig(cfg) paginator := kms.NewListAliasesPaginator(client, &kms.ListAliasesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -41,9 +42,9 @@ func KMSAlias(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func KMSAliasHandle(ctx context.Context, v types.AliasListEntry) Resource { +func KMSAliasHandle(ctx context.Context, v types.AliasListEntry) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AliasArn, Name: *v.AliasName, @@ -51,7 +52,7 @@ func KMSAliasHandle(ctx context.Context, v types.AliasListEntry) Resource { } return resource } -func GetKMSAlias(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetKMSAlias(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { keyId := fields["keyId"] client := kms.NewFromConfig(cfg) @@ -65,19 +66,19 @@ func GetKMSAlias(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Aliases { values = append(values, KMSAliasHandle(ctx, v)) } return values, nil } -func KMSKey(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func KMSKey(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := kms.NewFromConfig(cfg) paginator := kms.NewListKeysPaginator(client, &kms.ListKeysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -164,7 +165,7 @@ func KMSKey(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour title = *key.KeyMetadata.KeyId } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.KeyArn, Name: *v.KeyId, @@ -190,12 +191,12 @@ func KMSKey(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resour return values, nil } -func GetKMSKey(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetKMSKey(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) id := fields["id"] client := kms.NewFromConfig(cfg) - var values []Resource + var values []models.Resource key, err := client.DescribeKey(ctx, &kms.DescribeKeyInput{ KeyId: &id, }) @@ -266,7 +267,7 @@ func GetKMSKey(ctx context.Context, cfg aws.Config, fields map[string]string) ([ } } - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *key.KeyMetadata.Arn, Name: *v.KeyId, @@ -282,7 +283,7 @@ func GetKMSKey(ctx context.Context, cfg aws.Config, fields map[string]string) ([ return values, nil } -func KMSKeyRotation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func KMSKeyRotation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { logger := GetLoggerFromContext(ctx) logger.Info("KMSKeyRotation start working") @@ -294,7 +295,7 @@ func KMSKeyRotation(ctx context.Context, cfg aws.Config, stream *StreamSender) ( paginator := kms.NewListKeysPaginator(client, &kms.ListKeysInput{}) logger.Info("KMSKeyRotation start getting pages") - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -317,7 +318,7 @@ func KMSKeyRotation(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } for _, rotation := range output.Rotations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.KeyArn, Name: *v.KeyId, diff --git a/provider/describer/lambda.go b/provider/describer/lambda.go index 4ff70860..ed35b953 100755 --- a/provider/describer/lambda.go +++ b/provider/describer/lambda.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lambda" @@ -13,7 +14,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func LambdaFunction(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaFunction(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { logger := GetLoggerFromContext(ctx) logger.Info("LambdaFunction start working") @@ -22,7 +23,7 @@ func LambdaFunction(ctx context.Context, cfg aws.Config, stream *StreamSender) ( paginator := lambda.NewListFunctionsPaginator(client, &lambda.ListFunctionsInput{}) logger.Info("LambdaFunction start getting pages") - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -38,7 +39,7 @@ func LambdaFunction(ctx context.Context, cfg aws.Config, stream *StreamSender) ( if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -56,7 +57,7 @@ func LambdaFunction(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func lambdaFunctionHandle(ctx context.Context, client *lambda.Client, v types.FunctionConfiguration) (Resource, error) { +func lambdaFunctionHandle(ctx context.Context, client *lambda.Client, v types.FunctionConfiguration) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) listUrlConfig, err := client.ListFunctionUrlConfigs(ctx, &lambda.ListFunctionUrlConfigsInput{ @@ -66,7 +67,7 @@ func lambdaFunctionHandle(ctx context.Context, client *lambda.Client, v types.Fu if isErr(err, "ListFunctionUrlConfigsNotFound") || isErr(err, "InvalidParameterValue") { listUrlConfig = &lambda.ListFunctionUrlConfigsOutput{} } else { - return Resource{}, nil + return models.Resource{}, nil } } @@ -88,7 +89,7 @@ func lambdaFunctionHandle(ctx context.Context, client *lambda.Client, v types.Fu } if err != nil { - return Resource{}, err + return models.Resource{}, err } } @@ -96,10 +97,10 @@ func lambdaFunctionHandle(ctx context.Context, client *lambda.Client, v types.Fu FunctionName: v.FunctionName, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.FunctionArn, Name: *v.FunctionName, @@ -111,7 +112,7 @@ func lambdaFunctionHandle(ctx context.Context, client *lambda.Client, v types.Fu } return resource, nil } -func GetLambdaFunction(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetLambdaFunction(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { functionName := fields["name"] client := lambda.NewFromConfig(cfg) out, err := client.GetFunction(ctx, &lambda.GetFunctionInput{ @@ -122,13 +123,13 @@ func GetLambdaFunction(ctx context.Context, cfg aws.Config, fields map[string]st return nil, err } - var values []Resource + var values []models.Resource resource, err := lambdaFunctionHandle(ctx, client, *out.Configuration) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -137,14 +138,14 @@ func GetLambdaFunction(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func LambdaFunctionVersion(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaFunctionVersion(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := lambda.NewFromConfig(cfg) paginator := lambda.NewListFunctionsPaginator(client, &lambda.ListFunctionsInput{ FunctionVersion: types.FunctionVersionAll, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -166,7 +167,7 @@ func LambdaFunctionVersion(ctx context.Context, cfg aws.Config, stream *StreamSe } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: id, Description: model.LambdaFunctionVersionDescription{ @@ -186,7 +187,7 @@ func LambdaFunctionVersion(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func LambdaAlias(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaAlias(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { fns, err := LambdaFunction(ctx, cfg, nil) if err != nil { return nil, err @@ -194,7 +195,7 @@ func LambdaAlias(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R client := lambda.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, f := range fns { fn := f.Description.(model.LambdaFunctionDescription).Function.Configuration paginator := lambda.NewListAliasesPaginator(client, &lambda.ListAliasesInput{ @@ -229,7 +230,7 @@ func LambdaAlias(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R } return values, nil } -func LambdaAliasHandle(ctx context.Context, cfg aws.Config, v types.AliasConfiguration, fn *types.FunctionConfiguration) (Resource, error) { +func LambdaAliasHandle(ctx context.Context, cfg aws.Config, v types.AliasConfiguration, fn *types.FunctionConfiguration) (models.Resource, error) { client := lambda.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) @@ -241,7 +242,7 @@ func LambdaAliasHandle(ctx context.Context, cfg aws.Config, v types.AliasConfigu if isErr(err, "ResourceNotFoundException") { policy = &lambda.GetPolicyOutput{} } else { - return Resource{}, err + return models.Resource{}, err } } @@ -253,11 +254,11 @@ func LambdaAliasHandle(ctx context.Context, cfg aws.Config, v types.AliasConfigu if isErr(err, "ResourceNotFoundException") { urlConfig = &lambda.GetFunctionUrlConfigOutput{} } else { - return Resource{}, err + return models.Resource{}, err } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AliasArn, Name: *v.Name, @@ -270,7 +271,7 @@ func LambdaAliasHandle(ctx context.Context, cfg aws.Config, v types.AliasConfigu } return resource, nil } -func GetLambdaAlias(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetLambdaAlias(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { name := fields["aliasName"] client := lambda.NewFromConfig(cfg) @@ -279,7 +280,7 @@ func GetLambdaAlias(ctx context.Context, cfg aws.Config, fields map[string]strin return nil, err } - var values []Resource + var values []models.Resource for _, fn := range fns.Functions { out, err := client.GetAlias(ctx, &lambda.GetAliasInput{ @@ -308,7 +309,7 @@ func GetLambdaAlias(ctx context.Context, cfg aws.Config, fields map[string]strin return values, nil } -func LambdaPermission(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaPermission(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) fns, err := LambdaFunction(ctx, cfg, nil) if err != nil { @@ -317,7 +318,7 @@ func LambdaPermission(ctx context.Context, cfg aws.Config, stream *StreamSender) client := lambda.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, f := range fns { fn := f.Description.(model.LambdaFunctionDescription).Function.Configuration v, err := client.GetPolicy(ctx, &lambda.GetPolicyInput{ @@ -332,7 +333,7 @@ func LambdaPermission(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*fn.FunctionArn, *v.Policy), Name: *v.Policy, @@ -350,7 +351,7 @@ func LambdaPermission(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func LambdaEventInvokeConfig(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaEventInvokeConfig(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) fns, err := LambdaFunction(ctx, cfg, nil) if err != nil { @@ -359,7 +360,7 @@ func LambdaEventInvokeConfig(ctx context.Context, cfg aws.Config, stream *Stream client := lambda.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, f := range fns { fn := f.Description.(model.LambdaFunctionDescription).Function.Configuration paginator := lambda.NewListFunctionEventInvokeConfigsPaginator(client, &lambda.ListFunctionEventInvokeConfigsInput{ @@ -373,7 +374,7 @@ func LambdaEventInvokeConfig(ctx context.Context, cfg aws.Config, stream *Stream } for _, v := range page.FunctionEventInvokeConfigs { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *fn.FunctionName, // Invoke Config is unique per function Name: *fn.FunctionName, @@ -394,12 +395,12 @@ func LambdaEventInvokeConfig(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func LambdaCodeSigningConfig(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaCodeSigningConfig(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := lambda.NewFromConfig(cfg) paginator := lambda.NewListCodeSigningConfigsPaginator(client, &lambda.ListCodeSigningConfigsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -407,7 +408,7 @@ func LambdaCodeSigningConfig(ctx context.Context, cfg aws.Config, stream *Stream } for _, v := range page.CodeSigningConfigs { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.CodeSigningConfigArn, Name: *v.CodeSigningConfigArn, @@ -426,12 +427,12 @@ func LambdaCodeSigningConfig(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func LambdaEventSourceMapping(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaEventSourceMapping(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := lambda.NewFromConfig(cfg) paginator := lambda.NewListEventSourceMappingsPaginator(client, &lambda.ListEventSourceMappingsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -439,7 +440,7 @@ func LambdaEventSourceMapping(ctx context.Context, cfg aws.Config, stream *Strea } for _, v := range page.EventSourceMappings { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.EventSourceArn, Name: *v.UUID, @@ -458,7 +459,7 @@ func LambdaEventSourceMapping(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func LambdaLayerVersion(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaLayerVersion(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { layers, err := listLayers(ctx, cfg) if err != nil { return nil, err @@ -466,7 +467,7 @@ func LambdaLayerVersion(ctx context.Context, cfg aws.Config, stream *StreamSende client := lambda.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, layer := range layers { paginator := lambda.NewListLayerVersionsPaginator(client, &lambda.ListLayerVersionsInput{ LayerName: layer.LayerArn, @@ -497,7 +498,7 @@ func LambdaLayerVersion(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func lambdaLayerVersionHandle(ctx context.Context, cfg aws.Config, layer types.LayersListItem, v types.LayerVersionsListItem) (Resource, error) { +func lambdaLayerVersionHandle(ctx context.Context, cfg aws.Config, layer types.LayersListItem, v types.LayerVersionsListItem) (models.Resource, error) { client := lambda.NewFromConfig(cfg) describeCtx := GetDescribeContext(ctx) layerVersion, err := client.GetLayerVersion(ctx, &lambda.GetLayerVersionInput{ @@ -505,7 +506,7 @@ func lambdaLayerVersionHandle(ctx context.Context, cfg aws.Config, layer types.L VersionNumber: &v.Version, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } policy, err := client.GetLayerVersionPolicy(ctx, &lambda.GetLayerVersionPolicyInput{ @@ -516,11 +517,11 @@ func lambdaLayerVersionHandle(ctx context.Context, cfg aws.Config, layer types.L if isErr(err, "ResourceNotFoundException") { policy = &lambda.GetLayerVersionPolicyOutput{} } else { - return Resource{}, err + return models.Resource{}, err } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.LayerVersionArn, Name: *v.LayerVersionArn, @@ -533,7 +534,7 @@ func lambdaLayerVersionHandle(ctx context.Context, cfg aws.Config, layer types.L return resource, nil } -func GetLambdaLayerVersion(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetLambdaLayerVersion(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { layerArn := fields["arn"] client := lambda.NewFromConfig(cfg) @@ -545,7 +546,7 @@ func GetLambdaLayerVersion(ctx context.Context, cfg aws.Config, fields map[strin return nil, err } - var values []Resource + var values []models.Resource for _, layer := range layers.Layers { if *layer.LayerArn != layerArn { continue @@ -574,16 +575,16 @@ func GetLambdaLayerVersion(ctx context.Context, cfg aws.Config, fields map[strin return values, nil } -func LambdaLayer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaLayer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) layers, err := listLayers(ctx, cfg) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, layer := range layers { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *layer.LayerArn, Name: *layer.LayerName, @@ -603,7 +604,7 @@ func LambdaLayer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func LambdaLayerVersionPermission(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LambdaLayerVersionPermission(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) lvs, err := LambdaLayerVersion(ctx, cfg, nil) if err != nil { @@ -612,7 +613,7 @@ func LambdaLayerVersionPermission(ctx context.Context, cfg aws.Config, stream *S client := lambda.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, lv := range lvs { arn := lv.Description.(model.LambdaLayerVersionDescription).LayerVersion.LayerVersionArn version := lv.Description.(model.LambdaLayerVersionDescription).LayerVersion.Version @@ -624,7 +625,7 @@ func LambdaLayerVersionPermission(ctx context.Context, cfg aws.Config, stream *S return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*arn, fmt.Sprintf("%d", version)), Name: *arn, diff --git a/provider/describer/lightsail.go b/provider/describer/lightsail.go index 32faf1c5..67eda375 100755 --- a/provider/describer/lightsail.go +++ b/provider/describer/lightsail.go @@ -4,16 +4,17 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/lightsail/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lightsail" "github.com/opengovern/og-describer-aws/provider/model" ) -func LightsailInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func LightsailInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := lightsail.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { instances, err := client.GetInstances(ctx, &lightsail.GetInstancesInput{ PageToken: prevToken, @@ -42,9 +43,9 @@ func LightsailInstance(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func lightsailInstanceHandle(ctx context.Context, instance types.Instance) Resource { +func lightsailInstanceHandle(ctx context.Context, instance types.Instance) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *instance.Arn, Name: *instance.Name, @@ -54,9 +55,9 @@ func lightsailInstanceHandle(ctx context.Context, instance types.Instance) Resou } return resource } -func GetLightsailInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetLightsailInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { instanceName := fields["name"] - var values []Resource + var values []models.Resource client := lightsail.NewFromConfig(cfg) instance, err := client.GetInstance(ctx, &lightsail.GetInstanceInput{ diff --git a/provider/describer/macie2.go b/provider/describer/macie2.go index 95c15718..89d669af 100755 --- a/provider/describer/macie2.go +++ b/provider/describer/macie2.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -9,10 +10,10 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func Macie2ClassificationJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Macie2ClassificationJob(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := macie2.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { classificationJobs, err := client.ListClassificationJobs(ctx, &macie2.ListClassificationJobsInput{ NextToken: prevToken, @@ -34,7 +35,7 @@ func Macie2ClassificationJob(ctx context.Context, cfg aws.Config, stream *Stream return nil, err } } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -56,7 +57,7 @@ func Macie2ClassificationJob(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func macie2ClassificationJobHandle(ctx context.Context, cfg aws.Config, jobId string) (Resource, error) { +func macie2ClassificationJobHandle(ctx context.Context, cfg aws.Config, jobId string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := macie2.NewFromConfig(cfg) @@ -65,12 +66,12 @@ func macie2ClassificationJobHandle(ctx context.Context, cfg aws.Config, jobId st }) if err != nil { if isErr(err, "DescribeClassificationJobNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *job.JobArn, Name: *job.Name, @@ -81,15 +82,15 @@ func macie2ClassificationJobHandle(ctx context.Context, cfg aws.Config, jobId st } return resource, nil } -func GetMacie2ClassificationJob(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetMacie2ClassificationJob(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { jobId := fields["jobId"] - var values []Resource + var values []models.Resource resource, err := macie2ClassificationJobHandle(ctx, cfg, jobId) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/mediastore.go b/provider/describer/mediastore.go index 8348c51c..10a618d5 100755 --- a/provider/describer/mediastore.go +++ b/provider/describer/mediastore.go @@ -4,16 +4,17 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/mediastore/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mediastore" "github.com/opengovern/og-describer-aws/provider/model" ) -func MediaStoreContainer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func MediaStoreContainer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := mediastore.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { containers, err := client.ListContainers(ctx, &mediastore.ListContainersInput{ NextToken: prevToken, @@ -42,7 +43,7 @@ func MediaStoreContainer(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func mediaStoreContainerHandle(ctx context.Context, cfg aws.Config, container types.Container) Resource { +func mediaStoreContainerHandle(ctx context.Context, cfg aws.Config, container types.Container) models.Resource { describeCtx := GetDescribeContext(ctx) client := mediastore.NewFromConfig(cfg) @@ -60,7 +61,7 @@ func mediaStoreContainerHandle(ctx context.Context, cfg aws.Config, container ty tags = &mediastore.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *container.ARN, Name: *container.Name, @@ -73,9 +74,9 @@ func mediaStoreContainerHandle(ctx context.Context, cfg aws.Config, container ty return resource } -func GetMediaStoreContainer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetMediaStoreContainer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { containerName := fields["name"] - var values []Resource + var values []models.Resource client := mediastore.NewFromConfig(cfg) out, err := client.DescribeContainer(ctx, &mediastore.DescribeContainerInput{ ContainerName: &containerName, diff --git a/provider/describer/memorydb.go b/provider/describer/memorydb.go index 50c8a0fc..3e22795a 100755 --- a/provider/describer/memorydb.go +++ b/provider/describer/memorydb.go @@ -4,16 +4,17 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/memorydb/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/memorydb" "github.com/opengovern/og-describer-aws/provider/model" ) -func MemoryDbCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func MemoryDbCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := memorydb.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { clusters, err := client.DescribeClusters(ctx, &memorydb.DescribeClustersInput{ NextToken: prevToken, @@ -27,7 +28,7 @@ func MemoryDbCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -50,7 +51,7 @@ func MemoryDbCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func memoryDbClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Cluster) (Resource, error) { +func memoryDbClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Cluster) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := memorydb.NewFromConfig(cfg) tags, err := client.ListTags(ctx, &memorydb.ListTagsInput{ @@ -58,12 +59,12 @@ func memoryDbClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Cl }) if err != nil { if isErr(err, "ListTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *cluster.ARN, Name: *cluster.Name, @@ -74,7 +75,7 @@ func memoryDbClusterHandle(ctx context.Context, cfg aws.Config, cluster types.Cl } return resource, nil } -func GetMemoryDbCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetMemoryDbCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterName := fields["clusterName"] client := memorydb.NewFromConfig(cfg) @@ -88,13 +89,13 @@ func GetMemoryDbCluster(ctx context.Context, cfg aws.Config, fields map[string]s return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range describers.Clusters { resource, err := memoryDbClusterHandle(ctx, cfg, cluster) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/mgn.go b/provider/describer/mgn.go index d867d5fb..ed872228 100755 --- a/provider/describer/mgn.go +++ b/provider/describer/mgn.go @@ -2,16 +2,17 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mgn" "github.com/opengovern/og-describer-aws/provider/model" ) -func MGNApplication(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func MGNApplication(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := mgn.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { applications, err := client.ListApplications(ctx, &mgn.ListApplicationsInput{ NextToken: prevToken, @@ -24,7 +25,7 @@ func MGNApplication(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } for _, application := range applications.Items { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *application.Arn, Name: *application.Name, diff --git a/provider/describer/mq.go b/provider/describer/mq.go index be1dad7e..251d5835 100755 --- a/provider/describer/mq.go +++ b/provider/describer/mq.go @@ -4,17 +4,18 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/mq/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mq" "github.com/opengovern/og-describer-aws/provider/model" ) -func MQBroker(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func MQBroker(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := mq.NewFromConfig(cfg) paginator := mq.NewListBrokersPaginator(client, &mq.ListBrokersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -26,7 +27,7 @@ func MQBroker(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -43,7 +44,7 @@ func MQBroker(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func mQBrokerHandle(ctx context.Context, cfg aws.Config, v types.BrokerSummary) (Resource, error) { +func mQBrokerHandle(ctx context.Context, cfg aws.Config, v types.BrokerSummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := mq.NewFromConfig(cfg) tags, err := client.ListTags(ctx, &mq.ListTagsInput{ @@ -51,19 +52,19 @@ func mQBrokerHandle(ctx context.Context, cfg aws.Config, v types.BrokerSummary) }) if err != nil { if isErr(err, "ListTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } brokerDescription, err := client.DescribeBroker(ctx, &mq.DescribeBrokerInput{ BrokerId: v.BrokerId, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.BrokerArn, Name: *v.BrokerName, @@ -74,7 +75,7 @@ func mQBrokerHandle(ctx context.Context, cfg aws.Config, v types.BrokerSummary) } return resource, nil } -func GetMQBroker(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetMQBroker(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { brokerId := fields["id"] client := mq.NewFromConfig(cfg) @@ -86,7 +87,7 @@ func GetMQBroker(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, err } - var values []Resource + var values []models.Resource for _, broker := range brokers.BrokerSummaries { if *broker.BrokerId != brokerId { continue @@ -96,7 +97,7 @@ func GetMQBroker(ctx context.Context, cfg aws.Config, fields map[string]string) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } diff --git a/provider/describer/mwaa.go b/provider/describer/mwaa.go index 66368515..27022536 100755 --- a/provider/describer/mwaa.go +++ b/provider/describer/mwaa.go @@ -2,17 +2,18 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/mwaa" "github.com/opengovern/og-describer-aws/provider/model" ) -func MWAAEnvironment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func MWAAEnvironment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := mwaa.NewFromConfig(cfg) paginator := mwaa.NewListEnvironmentsPaginator(client, &mwaa.ListEnvironmentsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -24,7 +25,7 @@ func MWAAEnvironment(ctx context.Context, cfg aws.Config, stream *StreamSender) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -41,7 +42,7 @@ func MWAAEnvironment(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func mWAAEnvironmentHandle(ctx context.Context, cfg aws.Config, v string) (Resource, error) { +func mWAAEnvironmentHandle(ctx context.Context, cfg aws.Config, v string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := mwaa.NewFromConfig(cfg) environment, err := client.GetEnvironment(ctx, &mwaa.GetEnvironmentInput{ @@ -49,12 +50,12 @@ func mWAAEnvironmentHandle(ctx context.Context, cfg aws.Config, v string) (Resou }) if err != nil { if isErr(err, "GetEnvironmentNotFound") || isErr(err, "InvalidParameterVaLue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *environment.Environment.Arn, Name: *environment.Environment.Name, @@ -64,14 +65,14 @@ func mWAAEnvironmentHandle(ctx context.Context, cfg aws.Config, v string) (Resou } return resource, nil } -func GetMWAAEnvironment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetMWAAEnvironment(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { environmentName := fields["name"] - var values []Resource + var values []models.Resource resource, err := mWAAEnvironmentHandle(ctx, cfg, environmentName) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/neptune.go b/provider/describer/neptune.go index a9491f19..d0e5710b 100755 --- a/provider/describer/neptune.go +++ b/provider/describer/neptune.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/neptune" @@ -9,12 +10,12 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func NeptuneDatabase(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func NeptuneDatabase(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := neptune.NewFromConfig(cfg) paginator := neptune.NewDescribeDBInstancesPaginator(client, &neptune.DescribeDBInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -40,7 +41,7 @@ func NeptuneDatabase(ctx context.Context, cfg aws.Config, stream *StreamSender) name = *v.DBName } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBInstanceArn, Name: name, @@ -62,12 +63,12 @@ func NeptuneDatabase(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func NeptuneDatabaseCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func NeptuneDatabaseCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := neptune.NewFromConfig(cfg) paginator := neptune.NewDescribeDBClustersPaginator(client, &neptune.DescribeDBClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -93,7 +94,7 @@ func NeptuneDatabaseCluster(ctx context.Context, cfg aws.Config, stream *StreamS name = *v.DBClusterIdentifier } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBClusterArn, Name: name, @@ -115,11 +116,11 @@ func NeptuneDatabaseCluster(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func NeptuneDatabaseClusterSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func NeptuneDatabaseClusterSnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := neptune.NewFromConfig(cfg) paginator := neptune.NewDescribeDBClustersPaginator(client, &neptune.DescribeDBClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -165,7 +166,7 @@ func NeptuneDatabaseClusterSnapshot(ctx context.Context, cfg aws.Config, stream return values, nil } -func neptuneDatabaseClusterSnapshotHandler(ctx context.Context, client *neptune.Client, snapshot types.DBClusterSnapshot) (Resource, error) { +func neptuneDatabaseClusterSnapshotHandler(ctx context.Context, client *neptune.Client, snapshot types.DBClusterSnapshot) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) params := &neptune.DescribeDBClusterSnapshotAttributesInput{ @@ -174,7 +175,7 @@ func neptuneDatabaseClusterSnapshotHandler(ctx context.Context, client *neptune. dbClusterSnapshotData, err := client.DescribeDBClusterSnapshotAttributes(ctx, params) if err != nil { - return Resource{}, err + return models.Resource{}, err } var attributes = make([]map[string]interface{}, 0) @@ -196,7 +197,7 @@ func neptuneDatabaseClusterSnapshotHandler(ctx context.Context, client *neptune. } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *snapshot.DBClusterSnapshotArn, Name: *snapshot.DBClusterSnapshotIdentifier, diff --git a/provider/describer/networkfirewall.go b/provider/describer/networkfirewall.go index 26ff1437..e5f4b908 100755 --- a/provider/describer/networkfirewall.go +++ b/provider/describer/networkfirewall.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/networkfirewall" @@ -9,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func NetworkFirewallFirewall(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func NetworkFirewallFirewall(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := networkfirewall.NewFromConfig(cfg) paginator := networkfirewall.NewListFirewallsPaginator(client, &networkfirewall.ListFirewallsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -25,7 +26,7 @@ func NetworkFirewallFirewall(ctx context.Context, cfg aws.Config, stream *Stream if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -45,7 +46,7 @@ func NetworkFirewallFirewall(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func NetworkFirewallFirewallHandle(ctx context.Context, cfg aws.Config, v types.FirewallMetadata) (Resource, error) { +func NetworkFirewallFirewallHandle(ctx context.Context, cfg aws.Config, v types.FirewallMetadata) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := networkfirewall.NewFromConfig(cfg) firewall, err := client.DescribeFirewall(ctx, &networkfirewall.DescribeFirewallInput{ @@ -53,17 +54,17 @@ func NetworkFirewallFirewallHandle(ctx context.Context, cfg aws.Config, v types. FirewallArn: v.FirewallArn, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } firewallLogging, err := client.DescribeLoggingConfiguration(ctx, &networkfirewall.DescribeLoggingConfigurationInput{ FirewallArn: firewall.Firewall.FirewallArn, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.FirewallArn, Name: *v.FirewallName, @@ -75,8 +76,8 @@ func NetworkFirewallFirewallHandle(ctx context.Context, cfg aws.Config, v types. } return resource, nil } -func GetNetworkFirewallFirewall(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetNetworkFirewallFirewall(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource firewallArn := fields["firewallArn"] client := networkfirewall.NewFromConfig(cfg) @@ -96,7 +97,7 @@ func GetNetworkFirewallFirewall(ctx context.Context, cfg aws.Config, fields map[ if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -107,12 +108,12 @@ func GetNetworkFirewallFirewall(ctx context.Context, cfg aws.Config, fields map[ return values, nil } -func NetworkFirewallPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func NetworkFirewallPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := networkfirewall.NewFromConfig(cfg) paginator := networkfirewall.NewListFirewallPoliciesPaginator(client, &networkfirewall.ListFirewallPoliciesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -138,7 +139,7 @@ func NetworkFirewallPolicy(ctx context.Context, cfg aws.Config, stream *StreamSe } else { name = *v.Arn } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: name, @@ -160,12 +161,12 @@ func NetworkFirewallPolicy(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func NetworkFirewallRuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func NetworkFirewallRuleGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := networkfirewall.NewFromConfig(cfg) paginator := networkfirewall.NewListRuleGroupsPaginator(client, &networkfirewall.ListRuleGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -191,7 +192,7 @@ func NetworkFirewallRuleGroup(ctx context.Context, cfg aws.Config, stream *Strea } else { name = *v.Arn } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: name, diff --git a/provider/describer/oam.go b/provider/describer/oam.go index c71825dd..8ef8285f 100755 --- a/provider/describer/oam.go +++ b/provider/describer/oam.go @@ -2,18 +2,19 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/oam" "github.com/opengovern/og-describer-aws/provider/model" ) -func OAMLink(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OAMLink(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := oam.NewFromConfig(cfg) paginator := oam.NewListLinksPaginator(client, &oam.ListLinksInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -37,7 +38,7 @@ func OAMLink(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou name = *out.Id } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: name, @@ -58,12 +59,12 @@ func OAMLink(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou return values, nil } -func OAMSink(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OAMSink(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := oam.NewFromConfig(cfg) paginator := oam.NewListSinksPaginator(client, &oam.ListSinksInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -87,7 +88,7 @@ func OAMSink(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou name = *v.Name } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: name, diff --git a/provider/describer/opensearch.go b/provider/describer/opensearch.go index ec450e9d..d4f2fca7 100755 --- a/provider/describer/opensearch.go +++ b/provider/describer/opensearch.go @@ -5,13 +5,14 @@ import ( "math" "github.com/aws/aws-sdk-go-v2/service/opensearch/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/opensearch" "github.com/opengovern/og-describer-aws/provider/model" ) -func OpenSearchDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OpenSearchDomain(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := opensearch.NewFromConfig(cfg) domainNamesOutput, err := client.ListDomainNames(ctx, &opensearch.ListDomainNamesInput{}) @@ -23,7 +24,7 @@ func OpenSearchDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) domainNames = append(domainNames, *domainName.DomainName) } - var values []Resource + var values []models.Resource // OpenSearch API only allows 5 domains per request for i := 0; i < len(domainNames); i = i + 5 { domains, err := client.DescribeDomains(ctx, &opensearch.DescribeDomainsInput{ @@ -35,7 +36,7 @@ func OpenSearchDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) for _, domain := range domains.DomainStatusList { resource, err := openSearchDomainHandle(ctx, cfg, domain) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -54,7 +55,7 @@ func OpenSearchDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) } return values, nil } -func openSearchDomainHandle(ctx context.Context, cfg aws.Config, domain types.DomainStatus) (Resource, error) { +func openSearchDomainHandle(ctx context.Context, cfg aws.Config, domain types.DomainStatus) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := opensearch.NewFromConfig(cfg) @@ -63,12 +64,12 @@ func openSearchDomainHandle(ctx context.Context, cfg aws.Config, domain types.Do }) if err != nil { if isErr(err, "ListTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *domain.ARN, Name: *domain.DomainName, @@ -79,9 +80,9 @@ func openSearchDomainHandle(ctx context.Context, cfg aws.Config, domain types.Do } return resource, nil } -func GetOpenSearchDomain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetOpenSearchDomain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := opensearch.NewFromConfig(cfg) - var values []Resource + var values []models.Resource domainName := fields["domainName"] domain, err := client.DescribeDomain(ctx, &opensearch.DescribeDomainInput{ @@ -92,7 +93,7 @@ func GetOpenSearchDomain(ctx context.Context, cfg aws.Config, fields map[string] } resource, err := openSearchDomainHandle(ctx, cfg, *domain.DomainStatus) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/opensearchserverless.go b/provider/describer/opensearchserverless.go index c8192765..f4bf1cf8 100755 --- a/provider/describer/opensearchserverless.go +++ b/provider/describer/opensearchserverless.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/opensearchserverless" @@ -9,12 +10,12 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func OpenSearchServerlessCollection(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OpenSearchServerlessCollection(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := opensearchserverless.NewFromConfig(cfg) paginator := opensearchserverless.NewListCollectionsPaginator(client, &opensearchserverless.ListCollectionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -37,7 +38,7 @@ func OpenSearchServerlessCollection(ctx context.Context, cfg aws.Config, stream return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, diff --git a/provider/describer/opsworks.go b/provider/describer/opsworks.go index 0018a1d1..9d45a363 100755 --- a/provider/describer/opsworks.go +++ b/provider/describer/opsworks.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/opsworkscm" @@ -9,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func OpsWorksCMServer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OpsWorksCMServer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := opsworkscm.NewFromConfig(cfg) paginator := opsworkscm.NewDescribeServersPaginator(client, &opsworkscm.DescribeServersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -22,7 +23,7 @@ func OpsWorksCMServer(ctx context.Context, cfg aws.Config, stream *StreamSender) for _, v := range page.Servers { resource, err := opsWorksCMServerHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -42,7 +43,7 @@ func OpsWorksCMServer(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func opsWorksCMServerHandle(ctx context.Context, cfg aws.Config, v types.Server) (Resource, error) { +func opsWorksCMServerHandle(ctx context.Context, cfg aws.Config, v types.Server) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := opsworkscm.NewFromConfig(cfg) @@ -51,12 +52,12 @@ func opsWorksCMServerHandle(ctx context.Context, cfg aws.Config, v types.Server) }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ServerArn, Name: *v.ServerName, @@ -67,7 +68,7 @@ func opsWorksCMServerHandle(ctx context.Context, cfg aws.Config, v types.Server) } return resource, nil } -func GetOpsWorksCMServer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetOpsWorksCMServer(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { serverName := fields["name"] client := opsworkscm.NewFromConfig(cfg) @@ -77,11 +78,11 @@ func GetOpsWorksCMServer(ctx context.Context, cfg aws.Config, fields map[string] if err != nil { } - var values []Resource + var values []models.Resource for _, v := range server.Servers { resource, err := opsWorksCMServerHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/organizations.go b/provider/describer/organizations.go index d46d383f..2b378768 100755 --- a/provider/describer/organizations.go +++ b/provider/describer/organizations.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -23,7 +24,7 @@ func OrganizationOrganization(ctx context.Context, cfg aws.Config) (*types.Organ return req.Organization, nil } -func OrganizationsOrganization(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OrganizationsOrganization(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := organizations.NewFromConfig(cfg) req, err := client.DescribeOrganization(ctx, &organizations.DescribeOrganizationInput{}) @@ -31,7 +32,7 @@ func OrganizationsOrganization(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } - var values []Resource + var values []models.Resource resource := organizationsOrganizationHandle(ctx, req) if stream != nil { if err := (*stream)(resource); err != nil { @@ -43,9 +44,9 @@ func OrganizationsOrganization(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func organizationsOrganizationHandle(ctx context.Context, req *organizations.DescribeOrganizationOutput) Resource { +func organizationsOrganizationHandle(ctx context.Context, req *organizations.DescribeOrganizationOutput) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *req.Organization.Arn, Name: *req.Organization.Id, @@ -55,9 +56,9 @@ func organizationsOrganizationHandle(ctx context.Context, req *organizations.Des } return resource } -func GetOrganizationsOrganization(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetOrganizationsOrganization(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := organizations.NewFromConfig(cfg) - var values []Resource + var values []models.Resource describes, err := client.DescribeOrganization(ctx, &organizations.DescribeOrganizationInput{}) if err != nil { return nil, err @@ -100,13 +101,13 @@ func OrganizationAccounts(ctx context.Context, cfg aws.Config) ([]types.Account, return values, nil } -//func OrganizationsAccount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +//func OrganizationsAccount(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { // describeCtx := GetDescribeContext(ctx) // client := organizations.NewFromConfig(cfg) // // paginator := organizations.NewListAccountsPaginator(client, &organizations.ListAccountsInput{}) // -// var values []Resource +// var values []models.Resource // for paginator.HasMorePages() { // page, err := paginator.NextPage(ctx) // if err != nil { @@ -124,7 +125,7 @@ func OrganizationAccounts(ctx context.Context, cfg aws.Config) ([]types.Account, // return nil, err // } // -// resource := Resource{ +// resource := models.Resource{ // Region: describeCtx.OGRegion, // ARN: *acc.Arn, // Name: *acc.Name, @@ -146,8 +147,8 @@ func OrganizationAccounts(ctx context.Context, cfg aws.Config) ([]types.Account, // return values, nil //} -func OrganizationsPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { - var values []Resource +func OrganizationsPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { + var values []models.Resource for _, pType := range []types.PolicyType{types.PolicyTypeServiceControlPolicy, types.PolicyTypeTagPolicy, types.PolicyTypeBackupPolicy, types.PolicyTypeAiservicesOptOutPolicy} { resources, err := getOrganizationsPolicyByType(ctx, cfg, pType) @@ -167,12 +168,12 @@ func OrganizationsPolicy(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func getOrganizationsPolicyByType(ctx context.Context, cfg aws.Config, policyType types.PolicyType) ([]Resource, error) { +func getOrganizationsPolicyByType(ctx context.Context, cfg aws.Config, policyType types.PolicyType) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := organizations.NewFromConfig(cfg) paginator := organizations.NewListPoliciesPaginator(client, &organizations.ListPoliciesInput{Filter: policyType}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -187,7 +188,7 @@ func getOrganizationsPolicyByType(ctx context.Context, cfg aws.Config, policyTyp return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *p.Arn, Name: *p.Name, @@ -202,12 +203,12 @@ func getOrganizationsPolicyByType(ctx context.Context, cfg aws.Config, policyTyp return values, nil } -func OrganizationsRoot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OrganizationsRoot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := organizations.NewFromConfig(cfg) paginator := organizations.NewListRootsPaginator(client, &organizations.ListRootsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { output, err := paginator.NextPage(ctx) if err != nil { @@ -229,9 +230,9 @@ func OrganizationsRoot(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func organizationsRootHandle(ctx context.Context, root types.Root) Resource { +func organizationsRootHandle(ctx context.Context, root types.Root) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *root.Arn, Name: *root.Name, @@ -242,12 +243,12 @@ func organizationsRootHandle(ctx context.Context, root types.Root) Resource { return resource } -func OrganizationsOrganizationalUnit(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OrganizationsOrganizationalUnit(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := organizations.NewFromConfig(cfg) paginator := organizations.NewListRootsPaginator(client, &organizations.ListRootsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { output, err := paginator.NextPage(ctx) if err != nil { @@ -274,12 +275,12 @@ func OrganizationsOrganizationalUnit(ctx context.Context, cfg aws.Config, stream return values, nil } -func listAllNestedOUs(ctx context.Context, svc *organizations.Client, parentId string, currentPath string) ([]Resource, error) { +func listAllNestedOUs(ctx context.Context, svc *organizations.Client, parentId string, currentPath string) ([]models.Resource, error) { params := &organizations.ListOrganizationalUnitsForParentInput{ ParentId: aws.String(parentId), } paginator := organizations.NewListOrganizationalUnitsForParentPaginator(svc, params) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { output, err := paginator.NextPage(ctx) if err != nil { @@ -308,7 +309,7 @@ func listAllNestedOUs(ctx context.Context, svc *organizations.Client, parentId s return values, nil } -func organizationsOrganizationalUnitHandle(ctx context.Context, svc *organizations.Client, unit types.OrganizationalUnit, parentId, path string) (*Resource, error) { +func organizationsOrganizationalUnitHandle(ctx context.Context, svc *organizations.Client, unit types.OrganizationalUnit, parentId, path string) (*models.Resource, error) { describeCtx := GetDescribeContext(ctx) tagsResponse, err := svc.ListTagsForResource(ctx, &organizations.ListTagsForResourceInput{ ResourceId: unit.Id, @@ -320,7 +321,7 @@ func organizationsOrganizationalUnitHandle(ctx context.Context, svc *organizatio if tagsResponse != nil { tags = tagsResponse.Tags } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *unit.Arn, Name: *unit.Name, @@ -335,12 +336,12 @@ func organizationsOrganizationalUnitHandle(ctx context.Context, svc *organizatio return &resource, nil } -func OrganizationsPolicyTarget(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OrganizationsPolicyTarget(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := organizations.NewFromConfig(cfg) // We should get the policies for different target types - var values []Resource + var values []models.Resource // Accounts paginator := organizations.NewListAccountsPaginator(client, &organizations.ListAccountsInput{}) @@ -423,8 +424,8 @@ func OrganizationsPolicyTarget(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func organizationsPolicyForTarget(ctx context.Context, svc *organizations.Client, targetId string) ([]Resource, error) { - var values []Resource +func organizationsPolicyForTarget(ctx context.Context, svc *organizations.Client, targetId string) ([]models.Resource, error) { + var values []models.Resource for _, pType := range []types.PolicyType{types.PolicyTypeServiceControlPolicy, types.PolicyTypeTagPolicy, types.PolicyTypeBackupPolicy, types.PolicyTypeAiservicesOptOutPolicy} { resources, err := organizationsPolicyForTargetByPolicyType(ctx, svc, targetId, pType) @@ -438,10 +439,10 @@ func organizationsPolicyForTarget(ctx context.Context, svc *organizations.Client return values, nil } -func organizationsPolicyForTargetByPolicyType(ctx context.Context, svc *organizations.Client, targetId string, policyType types.PolicyType) ([]Resource, error) { +func organizationsPolicyForTargetByPolicyType(ctx context.Context, svc *organizations.Client, targetId string, policyType types.PolicyType) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) - var values []Resource + var values []models.Resource params := &organizations.ListPoliciesForTargetInput{ Filter: policyType, @@ -462,7 +463,7 @@ func organizationsPolicyForTargetByPolicyType(ctx context.Context, svc *organiza if err != nil { return nil, err } - values = append(values, Resource{ + values = append(values, models.Resource{ Region: describeCtx.OGRegion, ARN: *policy.Arn, Name: *policy.Name, diff --git a/provider/describer/organizations_account.go b/provider/describer/organizations_account.go index 06e5368c..4fcb584a 100644 --- a/provider/describer/organizations_account.go +++ b/provider/describer/organizations_account.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "math/rand" "os" "sync" @@ -103,10 +104,10 @@ func IsManagementAccount(ctx context.Context, cfg aws.Config) error { } // GetOrganizationAccounts fetches all organization accounts with their details. -func GetOrganizationAccounts(ctx context.Context, cfg aws.Config) ([]Resource, error) { +func GetOrganizationAccounts(ctx context.Context, cfg aws.Config) ([]models.Resource, error) { orgClient := organizations.NewFromConfig(cfg) - var accounts []Resource + var accounts []models.Resource var mu sync.Mutex // Protects the accounts slice input := &organizations.ListAccountsInput{} @@ -159,7 +160,7 @@ func GetOrganizationAccounts(ctx context.Context, cfg aws.Config) ([]Resource, e } // processAccount processes individual account details. -func processAccount(ctx context.Context, orgClient *organizations.Client, acct orgtypes.Account) (Resource, error) { +func processAccount(ctx context.Context, orgClient *organizations.Client, acct orgtypes.Account) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) // Get Tags @@ -168,7 +169,7 @@ func processAccount(ctx context.Context, orgClient *organizations.Client, acct o return limiter.Wait(ctx) }) if err != nil { - return Resource{}, err + return models.Resource{}, err } err = callWithRetry(ctx, func() error { var err error @@ -178,7 +179,7 @@ func processAccount(ctx context.Context, orgClient *organizations.Client, acct o return err }) if err != nil { - return Resource{}, err + return models.Resource{}, err } // Get Parent OU ID @@ -187,7 +188,7 @@ func processAccount(ctx context.Context, orgClient *organizations.Client, acct o return limiter.Wait(ctx) }) if err != nil { - return Resource{}, err + return models.Resource{}, err } err = callWithRetry(ctx, func() error { var err error @@ -197,17 +198,17 @@ func processAccount(ctx context.Context, orgClient *organizations.Client, acct o return err }) if err != nil { - return Resource{}, err + return models.Resource{}, err } if len(parentsOutput.Parents) == 0 { // No parent found - return Resource{}, fmt.Errorf("no parent found for account %s", aws.ToString(acct.Id)) + return models.Resource{}, fmt.Errorf("no parent found for account %s", aws.ToString(acct.Id)) } parent := parentsOutput.Parents[0] ouId := aws.ToString(parent.Id) - details := Resource{ + details := models.Resource{ Region: describeCtx.OGRegion, ARN: *acct.Arn, ID: *acct.Id, @@ -296,7 +297,7 @@ func pauseAllWorkers() { fmt.Fprintf(os.Stderr, "Increasing API rate limit to %v requests per second.\n", newLimit) } -func OrganizationsAccount(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func OrganizationsAccount(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { // Seed the random number generator for jitter rand.Seed(time.Now().UnixNano()) @@ -312,7 +313,7 @@ func OrganizationsAccount(ctx context.Context, cfg aws.Config, stream *StreamSen return nil, err } - values := make([]Resource, len(accounts)) + values := make([]models.Resource, len(accounts)) for _, resource := range accounts { if stream != nil { diff --git a/provider/describer/pinpoint.go b/provider/describer/pinpoint.go index 3a4dae04..3e4538ba 100755 --- a/provider/describer/pinpoint.go +++ b/provider/describer/pinpoint.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/service/pinpoint" "github.com/aws/aws-sdk-go-v2/service/pinpoint/types" @@ -10,7 +11,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func PinpointApp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func PinpointApp(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := pinpoint.NewFromConfig(cfg) @@ -18,7 +19,7 @@ func PinpointApp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R PageSize: aws.String("1000"), } - var values []Resource + var values []models.Resource for { apps, err := client.GetApps(ctx, input) if err != nil { @@ -47,7 +48,7 @@ func PinpointApp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R name = *app.Name } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *app.Arn, Name: name, diff --git a/provider/describer/pipes.go b/provider/describer/pipes.go index 39c88823..715e100a 100755 --- a/provider/describer/pipes.go +++ b/provider/describer/pipes.go @@ -4,17 +4,18 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/pipes" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/opengovern/og-describer-aws/provider/model" ) -func PipesPipe(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func PipesPipe(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := pipes.NewFromConfig(cfg) paginator := pipes.NewListPipesPaginator(client, &pipes.ListPipesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -32,7 +33,7 @@ func PipesPipe(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res name = *pipe.Name } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *pipe.Arn, Name: name, diff --git a/provider/describer/ram.go b/provider/describer/ram.go index 6e8219f1..3b9823d5 100755 --- a/provider/describer/ram.go +++ b/provider/describer/ram.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ram" @@ -9,10 +10,10 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func RamPrincipalAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RamPrincipalAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ram.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := ram.NewGetResourceShareAssociationsPaginator(client, &ram.GetResourceShareAssociationsInput{AssociationType: types.ResourceShareAssociationTypePrincipal}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -38,7 +39,7 @@ func RamPrincipalAssociation(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func GetRamPrincipalAssociation(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRamPrincipalAssociation(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { resourceShareArn := fields["ResourceShareArn"] client := ram.NewFromConfig(cfg) @@ -49,7 +50,7 @@ func GetRamPrincipalAssociation(ctx context.Context, cfg aws.Config, fields map[ return nil, err } - var values []Resource + var values []models.Resource for _, association := range associations.ResourceShareAssociations { resource, err := ramPrincipalAssociationHandle(ctx, cfg, association, resourceShareArn) if err != nil { @@ -59,7 +60,7 @@ func GetRamPrincipalAssociation(ctx context.Context, cfg aws.Config, fields map[ } return values, nil } -func ramPrincipalAssociationHandle(ctx context.Context, cfg aws.Config, association types.ResourceShareAssociation, resourceShareArn string) (Resource, error) { +func ramPrincipalAssociationHandle(ctx context.Context, cfg aws.Config, association types.ResourceShareAssociation, resourceShareArn string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ram.NewFromConfig(cfg) @@ -71,12 +72,12 @@ func ramPrincipalAssociationHandle(ctx context.Context, cfg aws.Config, associat for permissionPaginator.HasMorePages() { permissionPage, err := permissionPaginator.NextPage(ctx) if err != nil { - return Resource{}, err + return models.Resource{}, err } permissions = append(permissions, permissionPage.Permissions...) } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *association.ResourceShareName, ARN: *association.ResourceShareArn, @@ -88,10 +89,10 @@ func ramPrincipalAssociationHandle(ctx context.Context, cfg aws.Config, associat return resource, nil } -func RamResourceAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RamResourceAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ram.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := ram.NewGetResourceShareAssociationsPaginator(client, &ram.GetResourceShareAssociationsInput{AssociationType: types.ResourceShareAssociationTypeResource}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -116,7 +117,7 @@ func RamResourceAssociation(ctx context.Context, cfg aws.Config, stream *StreamS } return values, nil } -func ramResourceAssociationHandle(ctx context.Context, cfg aws.Config, association types.ResourceShareAssociation, resourceShareArn string) (Resource, error) { +func ramResourceAssociationHandle(ctx context.Context, cfg aws.Config, association types.ResourceShareAssociation, resourceShareArn string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ram.NewFromConfig(cfg) permissionPaginator := ram.NewListResourceSharePermissionsPaginator(client, &ram.ListResourceSharePermissionsInput{ @@ -126,12 +127,12 @@ func ramResourceAssociationHandle(ctx context.Context, cfg aws.Config, associati for permissionPaginator.HasMorePages() { permissionPage, err := permissionPaginator.NextPage(ctx) if err != nil { - return Resource{}, err + return models.Resource{}, err } permissions = append(permissions, permissionPage.Permissions...) } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *association.ResourceShareName, ARN: *association.ResourceShareArn, @@ -142,7 +143,7 @@ func ramResourceAssociationHandle(ctx context.Context, cfg aws.Config, associati } return resource, nil } -func GetRamResourceAssociation(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRamResourceAssociation(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { resourceShareArn := fields["resourceShareArn"] client := ram.NewFromConfig(cfg) @@ -153,7 +154,7 @@ func GetRamResourceAssociation(ctx context.Context, cfg aws.Config, fields map[s return nil, err } - var values []Resource + var values []models.Resource for _, association := range associations.ResourceShareAssociations { resource, err := ramResourceAssociationHandle(ctx, cfg, association, resourceShareArn) diff --git a/provider/describer/rds.go b/provider/describer/rds.go index 205f879b..378be512 100755 --- a/provider/describer/rds.go +++ b/provider/describer/rds.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/rds" @@ -9,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func RDSDBCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBClustersPaginator(client, &rds.DescribeDBClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -34,7 +35,7 @@ func RDSDBCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func rDSDBClusterHandle(ctx context.Context, client *rds.Client, v types.DBCluster) Resource { +func rDSDBClusterHandle(ctx context.Context, client *rds.Client, v types.DBCluster) models.Resource { var actions []types.ResourcePendingMaintenanceActions pendingMaintenanceActions, err := client.DescribePendingMaintenanceActions(ctx, &rds.DescribePendingMaintenanceActionsInput{ Filters: []types.Filter{ @@ -48,7 +49,7 @@ func rDSDBClusterHandle(ctx context.Context, client *rds.Client, v types.DBClust actions = pendingMaintenanceActions.PendingMaintenanceActions } describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBClusterArn, Name: *v.DBClusterIdentifier, @@ -59,7 +60,7 @@ func rDSDBClusterHandle(ctx context.Context, client *rds.Client, v types.DBClust } return resource } -func GetRDSDBCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRDSDBCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] client := rds.NewFromConfig(cfg) @@ -73,7 +74,7 @@ func GetRDSDBCluster(ctx context.Context, cfg aws.Config, fields map[string]stri return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.DBClusters { resource := rDSDBClusterHandle(ctx, client, v) values = append(values, resource) @@ -82,11 +83,11 @@ func GetRDSDBCluster(ctx context.Context, cfg aws.Config, fields map[string]stri return values, nil } -func RDSDBClusterSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBClusterSnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBClusterSnapshotsPaginator(client, &rds.DescribeDBClusterSnapshotsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -95,7 +96,7 @@ func RDSDBClusterSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSen for _, v := range page.DBClusterSnapshots { resource, err := rDSDBClusterSnapshotHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -115,7 +116,7 @@ func RDSDBClusterSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func rDSDBClusterSnapshotHandle(ctx context.Context, cfg aws.Config, v types.DBClusterSnapshot) (Resource, error) { +func rDSDBClusterSnapshotHandle(ctx context.Context, cfg aws.Config, v types.DBClusterSnapshot) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) @@ -124,12 +125,12 @@ func rDSDBClusterSnapshotHandle(ctx context.Context, cfg aws.Config, v types.DBC }) if err != nil { if isErr(err, "DescribeDBClusterSnapshotAttributesNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBClusterSnapshotArn, Name: *v.DBClusterSnapshotIdentifier, @@ -140,10 +141,10 @@ func rDSDBClusterSnapshotHandle(ctx context.Context, cfg aws.Config, v types.DBC } return resource, nil } -func GetRDSDBClusterSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRDSDBClusterSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { DBClusterSnapshotIdentifier := fields["ClusterSnapshotId"] SnapshotType := fields["snapshotType"] - var values []Resource + var values []models.Resource client := rds.NewFromConfig(cfg) clusterSnapshot, err := client.DescribeDBClusterSnapshots(ctx, &rds.DescribeDBClusterSnapshotsInput{ @@ -159,7 +160,7 @@ func GetRDSDBClusterSnapshot(ctx context.Context, cfg aws.Config, fields map[str for _, v := range clusterSnapshot.DBClusterSnapshots { resource, err := rDSDBClusterSnapshotHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -172,12 +173,12 @@ func GetRDSDBClusterSnapshot(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func RDSDBClusterParameterGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBClusterParameterGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBClusterParameterGroupsPaginator(client, &rds.DescribeDBClusterParameterGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -204,7 +205,7 @@ func RDSDBClusterParameterGroup(ctx context.Context, cfg aws.Config, stream *Str tags = op.TagList } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBClusterParameterGroupArn, Name: *v.DBClusterParameterGroupName, @@ -227,11 +228,11 @@ func RDSDBClusterParameterGroup(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func RDSDBInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBInstancesPaginator(client, &rds.DescribeDBInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -258,7 +259,7 @@ func RDSDBInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func rDSDBInstanceHandle(ctx context.Context, client *rds.Client, v types.DBInstance) (*Resource, error) { +func rDSDBInstanceHandle(ctx context.Context, client *rds.Client, v types.DBInstance) (*models.Resource, error) { describeCtx := GetDescribeContext(ctx) pendingMaintenance, err := client.DescribePendingMaintenanceActions(ctx, &rds.DescribePendingMaintenanceActionsInput{ ResourceIdentifier: v.DBInstanceArn, @@ -279,7 +280,7 @@ func rDSDBInstanceHandle(ctx context.Context, client *rds.Client, v types.DBInst return nil, nil } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBInstanceArn, Name: *v.DBInstanceIdentifier, @@ -291,7 +292,7 @@ func rDSDBInstanceHandle(ctx context.Context, client *rds.Client, v types.DBInst } return &resource, nil } -func GetRDSDBInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRDSDBInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { dbInstanceId := fields["id"] client := rds.NewFromConfig(cfg) @@ -305,7 +306,7 @@ func GetRDSDBInstance(ctx context.Context, cfg aws.Config, fields map[string]str return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.DBInstances { resource, err := rDSDBInstanceHandle(ctx, client, v) if err != nil { @@ -320,12 +321,12 @@ func GetRDSDBInstance(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func RDSDBParameterGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBParameterGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBParameterGroupsPaginator(client, &rds.DescribeDBParameterGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -347,7 +348,7 @@ func RDSDBParameterGroup(ctx context.Context, cfg aws.Config, stream *StreamSend return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBParameterGroupArn, Name: *v.DBParameterGroupName, @@ -370,12 +371,12 @@ func RDSDBParameterGroup(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func RDSDBProxy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBProxy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBProxiesPaginator(client, &rds.DescribeDBProxiesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -390,7 +391,7 @@ func RDSDBProxy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re tags = &rds.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBProxyArn, Name: *v.DBProxyName, @@ -412,12 +413,12 @@ func RDSDBProxy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func RDSDBProxyEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBProxyEndpoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBProxyEndpointsPaginator(client, &rds.DescribeDBProxyEndpointsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -425,7 +426,7 @@ func RDSDBProxyEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, v := range page.DBProxyEndpoints { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBProxyEndpointArn, Name: *v.DBProxyEndpointName, @@ -444,7 +445,7 @@ func RDSDBProxyEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func RDSDBProxyTargetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBProxyTargetGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) proxies, err := RDSDBProxy(ctx, cfg, nil) if err != nil { @@ -453,7 +454,7 @@ func RDSDBProxyTargetGroup(ctx context.Context, cfg aws.Config, stream *StreamSe client := rds.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, p := range proxies { proxy := p.Description.(types.DBProxy) paginator := rds.NewDescribeDBProxyTargetGroupsPaginator(client, &rds.DescribeDBProxyTargetGroupsInput{ @@ -467,7 +468,7 @@ func RDSDBProxyTargetGroup(ctx context.Context, cfg aws.Config, stream *StreamSe } for _, v := range page.TargetGroups { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TargetGroupArn, Name: *v.TargetGroupName, @@ -487,12 +488,12 @@ func RDSDBProxyTargetGroup(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func RDSDBSecurityGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBSecurityGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBSecurityGroupsPaginator(client, &rds.DescribeDBSecurityGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -500,7 +501,7 @@ func RDSDBSecurityGroup(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, v := range page.DBSecurityGroups { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBSecurityGroupArn, Name: *v.DBSecurityGroupName, @@ -519,12 +520,12 @@ func RDSDBSecurityGroup(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func RDSDBSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBSubnetGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBSubnetGroupsPaginator(client, &rds.DescribeDBSubnetGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -539,7 +540,7 @@ func RDSDBSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBSubnetGroupArn, Name: *v.DBSubnetGroupName, @@ -561,11 +562,11 @@ func RDSDBSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func RDSDBEventSubscription(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBEventSubscription(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeEventSubscriptionsPaginator(client, &rds.DescribeEventSubscriptionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -586,9 +587,9 @@ func RDSDBEventSubscription(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func rDSDBEventSubscriptionHandle(ctx context.Context, v types.EventSubscription) Resource { +func rDSDBEventSubscriptionHandle(ctx context.Context, v types.EventSubscription) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.EventSubscriptionArn, Name: *v.CustSubscriptionId, @@ -598,9 +599,9 @@ func rDSDBEventSubscriptionHandle(ctx context.Context, v types.EventSubscription } return resource } -func GetRDSDBEventSubscription(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRDSDBEventSubscription(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { subscriptionName := fields["name"] - var values []Resource + var values []models.Resource client := rds.NewFromConfig(cfg) describes, err := client.DescribeEventSubscriptions(ctx, &rds.DescribeEventSubscriptionsInput{ @@ -619,11 +620,11 @@ func GetRDSDBEventSubscription(ctx context.Context, cfg aws.Config, fields map[s return values, nil } -func RDSGlobalCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSGlobalCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeGlobalClustersPaginator(client, &rds.DescribeGlobalClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -644,7 +645,7 @@ func RDSGlobalCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func rDSGlobalClusterHandle(ctx context.Context, cfg aws.Config, v types.GlobalCluster) Resource { +func rDSGlobalClusterHandle(ctx context.Context, cfg aws.Config, v types.GlobalCluster) models.Resource { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) @@ -655,7 +656,7 @@ func rDSGlobalClusterHandle(ctx context.Context, cfg aws.Config, v types.GlobalC tags = &rds.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.GlobalClusterArn, Name: *v.GlobalClusterIdentifier, @@ -666,8 +667,8 @@ func rDSGlobalClusterHandle(ctx context.Context, cfg aws.Config, v types.GlobalC } return resource } -func GetRDSGlobalCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetRDSGlobalCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource arn := fields["arn"] client := rds.NewFromConfig(cfg) @@ -687,11 +688,11 @@ func GetRDSGlobalCluster(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func RDSOptionGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSOptionGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeOptionGroupsPaginator(client, &rds.DescribeOptionGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -700,7 +701,7 @@ func RDSOptionGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ( for _, v := range page.OptionGroupsList { resource, err := rDSOptionGroupHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -720,7 +721,7 @@ func RDSOptionGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func rDSOptionGroupHandle(ctx context.Context, cfg aws.Config, v types.OptionGroup) (Resource, error) { +func rDSOptionGroupHandle(ctx context.Context, cfg aws.Config, v types.OptionGroup) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) @@ -729,12 +730,12 @@ func rDSOptionGroupHandle(ctx context.Context, cfg aws.Config, v types.OptionGro }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.OptionGroupArn, Name: *v.OptionGroupName, @@ -745,9 +746,9 @@ func rDSOptionGroupHandle(ctx context.Context, cfg aws.Config, v types.OptionGro } return resource, nil } -func GetRDSOptionGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRDSOptionGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { optionGroupName := fields["name"] - var values []Resource + var values []models.Resource client := rds.NewFromConfig(cfg) describers, err := client.DescribeOptionGroups(ctx, &rds.DescribeOptionGroupsInput{ @@ -762,7 +763,7 @@ func GetRDSOptionGroup(ctx context.Context, cfg aws.Config, fields map[string]st for _, v := range describers.OptionGroupsList { resource, err := rDSOptionGroupHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -775,11 +776,11 @@ func GetRDSOptionGroup(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func RDSDBSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBSnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBSnapshotsPaginator(client, &rds.DescribeDBSnapshotsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -788,7 +789,7 @@ func RDSDBSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ for _, v := range page.DBSnapshots { resource, err := rDSDBSnapshotHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -808,7 +809,7 @@ func RDSDBSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func rDSDBSnapshotHandle(ctx context.Context, cfg aws.Config, v types.DBSnapshot) (Resource, error) { +func rDSDBSnapshotHandle(ctx context.Context, cfg aws.Config, v types.DBSnapshot) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := rds.NewFromConfig(cfg) attrs, err := client.DescribeDBSnapshotAttributes(ctx, &rds.DescribeDBSnapshotAttributesInput{ @@ -816,12 +817,12 @@ func rDSDBSnapshotHandle(ctx context.Context, cfg aws.Config, v types.DBSnapshot }) if err != nil { if isErr(err, "DescribeDBSnapshotAttributesNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBSnapshotArn, Name: *v.DBSnapshotIdentifier, @@ -833,9 +834,9 @@ func rDSDBSnapshotHandle(ctx context.Context, cfg aws.Config, v types.DBSnapshot return resource, nil } -func GetRDSDBSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRDSDBSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { dbiResourceId := fields["id"] - var values []Resource + var values []models.Resource client := rds.NewFromConfig(cfg) describers, err := client.DescribeDBSnapshots(ctx, &rds.DescribeDBSnapshotsInput{ DbiResourceId: &dbiResourceId, @@ -849,7 +850,7 @@ func GetRDSDBSnapshot(ctx context.Context, cfg aws.Config, fields map[string]str for _, v := range describers.DBSnapshots { resource, err := rDSDBSnapshotHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -862,11 +863,11 @@ func GetRDSDBSnapshot(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func RDSReservedDBInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSReservedDBInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeReservedDBInstancesPaginator(client, &rds.DescribeReservedDBInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -887,9 +888,9 @@ func RDSReservedDBInstance(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func rDSReservedDBInstanceHandle(ctx context.Context, reservedDBInstance types.ReservedDBInstance) Resource { +func rDSReservedDBInstanceHandle(ctx context.Context, reservedDBInstance types.ReservedDBInstance) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *reservedDBInstance.ReservedDBInstanceArn, ID: *reservedDBInstance.ReservedDBInstanceId, @@ -899,9 +900,9 @@ func rDSReservedDBInstanceHandle(ctx context.Context, reservedDBInstance types.R } return resource } -func GetRDSReservedDBInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRDSReservedDBInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { reservedDBInstanceId := fields["id"] - var values []Resource + var values []models.Resource client := rds.NewFromConfig(cfg) describers, err := client.DescribeReservedDBInstances(ctx, &rds.DescribeReservedDBInstancesInput{ @@ -920,11 +921,11 @@ func GetRDSReservedDBInstance(ctx context.Context, cfg aws.Config, fields map[st return values, nil } -func RDSDBInstanceAutomatedBackup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBInstanceAutomatedBackup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBInstanceAutomatedBackupsPaginator(client, &rds.DescribeDBInstanceAutomatedBackupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -945,9 +946,9 @@ func RDSDBInstanceAutomatedBackup(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func rDSDBInstanceAutomatedBackupHandle(ctx context.Context, v types.DBInstanceAutomatedBackup) Resource { +func rDSDBInstanceAutomatedBackupHandle(ctx context.Context, v types.DBInstanceAutomatedBackup) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.DBInstanceArn, ID: *v.DBInstanceIdentifier, @@ -957,7 +958,7 @@ func rDSDBInstanceAutomatedBackupHandle(ctx context.Context, v types.DBInstanceA } return resource } -func GetRDSDBInstanceAutomatedBackup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRDSDBInstanceAutomatedBackup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] client := rds.NewFromConfig(cfg) @@ -971,7 +972,7 @@ func GetRDSDBInstanceAutomatedBackup(ctx context.Context, cfg aws.Config, fields return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.DBInstanceAutomatedBackups { resource := rDSDBInstanceAutomatedBackupHandle(ctx, v) values = append(values, resource) @@ -980,11 +981,11 @@ func GetRDSDBInstanceAutomatedBackup(ctx context.Context, cfg aws.Config, fields return values, nil } -func RDSDBEngineVersion(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBEngineVersion(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := rds.NewFromConfig(cfg) paginator := rds.NewDescribeDBEngineVersionsPaginator(client, &rds.DescribeDBEngineVersionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1009,13 +1010,13 @@ func RDSDBEngineVersion(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func rDSDBEngineVersionHandle(ctx context.Context, v types.DBEngineVersion) Resource { +func rDSDBEngineVersionHandle(ctx context.Context, v types.DBEngineVersion) models.Resource { var arn string if v.DBEngineVersionArn != nil { arn = *v.DBEngineVersionArn } describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Description: model.RDSDBEngineVersionDescription{ @@ -1025,7 +1026,7 @@ func rDSDBEngineVersionHandle(ctx context.Context, v types.DBEngineVersion) Reso return resource } -func RDSDBRecommendation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RDSDBRecommendation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { logger := GetLoggerFromContext(ctx) logger.Info("RDSDBRecommendation start working") @@ -1034,7 +1035,7 @@ func RDSDBRecommendation(ctx context.Context, cfg aws.Config, stream *StreamSend paginator := rds.NewDescribeDBRecommendationsPaginator(client, &rds.DescribeDBRecommendationsInput{}) logger.Info("RDSDBRecommendation start getting pages") - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1058,10 +1059,10 @@ func RDSDBRecommendation(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func rDSDBRecommendationHandler(ctx context.Context, v types.DBRecommendation) Resource { +func rDSDBRecommendationHandler(ctx context.Context, v types.DBRecommendation) models.Resource { describeCtx := GetDescribeContext(ctx) - return Resource{ + return models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ResourceArn, Description: model.RDSDBRecommendationDescription{ diff --git a/provider/describer/redshift.go b/provider/describer/redshift.go index c21f5e7d..bbada8c8 100755 --- a/provider/describer/redshift.go +++ b/provider/describer/redshift.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" types2 "github.com/aws/aws-sdk-go-v2/service/redshiftserverless/types" @@ -16,11 +17,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func RedshiftCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftCluster(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := redshift.NewFromConfig(cfg) paginator := redshift.NewDescribeClustersPaginator(client, &redshift.DescribeClustersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -29,7 +30,7 @@ func RedshiftCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) for _, v := range page.Clusters { resource, err := redshiftClusterHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -49,7 +50,7 @@ func RedshiftCluster(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func redshiftClusterHandle(ctx context.Context, cfg aws.Config, v types.Cluster) (Resource, error) { +func redshiftClusterHandle(ctx context.Context, cfg aws.Config, v types.Cluster) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := redshift.NewFromConfig(cfg) logStatus, err := client.DescribeLoggingStatus(ctx, &redshift.DescribeLoggingStatusInput{ @@ -57,9 +58,9 @@ func redshiftClusterHandle(ctx context.Context, cfg aws.Config, v types.Cluster) }) if err != nil { if isErr(err, "DescribeLoggingStatusNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } sactions, err := client.DescribeScheduledActions(ctx, &redshift.DescribeScheduledActionsInput{ @@ -72,12 +73,12 @@ func redshiftClusterHandle(ctx context.Context, cfg aws.Config, v types.Cluster) }) if err != nil { if isErr(err, "DescribeScheduledActionsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ClusterNamespaceArn, Name: *v.ClusterIdentifier, @@ -89,7 +90,7 @@ func redshiftClusterHandle(ctx context.Context, cfg aws.Config, v types.Cluster) } return resource, nil } -func GetRedshiftCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRedshiftCluster(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { tagKey := fields["tagKey"] tagValue := fields["tagValue"] client := redshift.NewFromConfig(cfg) @@ -105,10 +106,10 @@ func GetRedshiftCluster(ctx context.Context, cfg aws.Config, fields map[string]s return nil, err } - var values []Resource + var values []models.Resource for _, cluster := range out.Clusters { resource, err := redshiftClusterHandle(ctx, cfg, cluster) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -121,12 +122,12 @@ func GetRedshiftCluster(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func RedshiftEventSubscription(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftEventSubscription(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := redshift.NewFromConfig(cfg) paginator := redshift.NewDescribeEventSubscriptionsPaginator(client, &redshift.DescribeEventSubscriptionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -134,7 +135,7 @@ func RedshiftEventSubscription(ctx context.Context, cfg aws.Config, stream *Stre } for _, v := range page.EventSubscriptionsList { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.CustSubscriptionId, Name: *v.CustSubscriptionId, @@ -155,11 +156,11 @@ func RedshiftEventSubscription(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func RedshiftClusterParameterGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftClusterParameterGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := redshift.NewFromConfig(cfg) paginator := redshift.NewDescribeClusterParameterGroupsPaginator(client, &redshift.DescribeClusterParameterGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -168,7 +169,7 @@ func RedshiftClusterParameterGroup(ctx context.Context, cfg aws.Config, stream * for _, v := range page.ParameterGroups { resource, err := redshiftClusterParameterGroupHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -188,7 +189,7 @@ func RedshiftClusterParameterGroup(ctx context.Context, cfg aws.Config, stream * return values, nil } -func redshiftClusterParameterGroupHandle(ctx context.Context, cfg aws.Config, v types.ClusterParameterGroup) (Resource, error) { +func redshiftClusterParameterGroupHandle(ctx context.Context, cfg aws.Config, v types.ClusterParameterGroup) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := redshift.NewFromConfig(cfg) @@ -197,9 +198,9 @@ func redshiftClusterParameterGroupHandle(ctx context.Context, cfg aws.Config, v }) if err != nil { if isErr(err, "DescribeClusterParametersNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } arn := "arn:" + describeCtx.Partition + ":redshift:" + describeCtx.Region + ":" + describeCtx.AccountID + ":parametergroup" @@ -209,7 +210,7 @@ func redshiftClusterParameterGroupHandle(ctx context.Context, cfg aws.Config, v arn = arn + ":" + *v.ParameterGroupName } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.ParameterGroupName, @@ -220,7 +221,7 @@ func redshiftClusterParameterGroupHandle(ctx context.Context, cfg aws.Config, v } return resource, nil } -func GetRedshiftClusterParameterGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRedshiftClusterParameterGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { ParameterGroupName := fields["name"] client := redshift.NewFromConfig(cfg) @@ -234,11 +235,11 @@ func GetRedshiftClusterParameterGroup(ctx context.Context, cfg aws.Config, field return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.ParameterGroups { resource, err := redshiftClusterParameterGroupHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -251,12 +252,12 @@ func GetRedshiftClusterParameterGroup(ctx context.Context, cfg aws.Config, field return values, nil } -func RedshiftClusterSecurityGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftClusterSecurityGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := redshift.NewFromConfig(cfg) paginator := redshift.NewDescribeClusterSecurityGroupsPaginator(client, &redshift.DescribeClusterSecurityGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -269,7 +270,7 @@ func RedshiftClusterSecurityGroup(ctx context.Context, cfg aws.Config, stream *S } for _, v := range page.ClusterSecurityGroups { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ClusterSecurityGroupName, Name: *v.ClusterSecurityGroupName, @@ -288,12 +289,12 @@ func RedshiftClusterSecurityGroup(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func RedshiftClusterSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftClusterSubnetGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := redshift.NewFromConfig(cfg) paginator := redshift.NewDescribeClusterSubnetGroupsPaginator(client, &redshift.DescribeClusterSubnetGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -301,7 +302,7 @@ func RedshiftClusterSubnetGroup(ctx context.Context, cfg aws.Config, stream *Str } for _, v := range page.ClusterSubnetGroups { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ClusterSubnetGroupName, Name: *v.ClusterSubnetGroupName, @@ -320,11 +321,11 @@ func RedshiftClusterSubnetGroup(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func RedshiftSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftSnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := redshift.NewFromConfig(cfg) paginator := redshift.NewDescribeClusterSnapshotsPaginator(client, &redshift.DescribeClusterSnapshotsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -348,10 +349,10 @@ func RedshiftSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func redshiftSnapshotHandle(ctx context.Context, v types.Snapshot) Resource { +func redshiftSnapshotHandle(ctx context.Context, v types.Snapshot) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:redshift:%s:%s:snapshot:%s/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.ClusterIdentifier, *v.SnapshotIdentifier) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.SnapshotIdentifier, @@ -361,7 +362,7 @@ func redshiftSnapshotHandle(ctx context.Context, v types.Snapshot) Resource { } return resource } -func GetRedshiftSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRedshiftSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { clusterIdentifier := fields["id"] client := redshift.NewFromConfig(cfg) @@ -376,7 +377,7 @@ func GetRedshiftSnapshot(ctx context.Context, cfg aws.Config, fields map[string] return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Snapshots { values = append(values, redshiftSnapshotHandle(ctx, v)) } @@ -384,11 +385,11 @@ func GetRedshiftSnapshot(ctx context.Context, cfg aws.Config, fields map[string] return values, nil } -func RedshiftServerlessNamespace(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftServerlessNamespace(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := redshiftserverless.NewFromConfig(cfg) paginator := redshiftserverless.NewListNamespacesPaginator(client, &redshiftserverless.ListNamespacesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -397,7 +398,7 @@ func RedshiftServerlessNamespace(ctx context.Context, cfg aws.Config, stream *St for _, v := range page.Namespaces { resource, err := redshiftServerlessNamespaceHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -417,7 +418,7 @@ func RedshiftServerlessNamespace(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func redshiftServerlessNamespaceHandle(ctx context.Context, cfg aws.Config, v types2.Namespace) (Resource, error) { +func redshiftServerlessNamespaceHandle(ctx context.Context, cfg aws.Config, v types2.Namespace) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := redshiftserverless.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &redshiftserverless.ListTagsForResourceInput{ @@ -425,12 +426,12 @@ func redshiftServerlessNamespaceHandle(ctx context.Context, cfg aws.Config, v ty }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.NamespaceArn, Name: *v.NamespaceName, @@ -441,9 +442,9 @@ func redshiftServerlessNamespaceHandle(ctx context.Context, cfg aws.Config, v ty } return resource, nil } -func GetRedshiftServerlessNamespace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRedshiftServerlessNamespace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { namespaceName := fields["name"] - var values []Resource + var values []models.Resource client := redshiftserverless.NewFromConfig(cfg) namespaces, err := client.GetNamespace(ctx, &redshiftserverless.GetNamespaceInput{ @@ -457,7 +458,7 @@ func GetRedshiftServerlessNamespace(ctx context.Context, cfg aws.Config, fields } resource, err := redshiftServerlessNamespaceHandle(ctx, cfg, *namespaces.Namespace) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -469,11 +470,11 @@ func GetRedshiftServerlessNamespace(ctx context.Context, cfg aws.Config, fields return values, nil } -func RedshiftServerlessSnapshot(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftServerlessSnapshot(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := redshiftserverless.NewFromConfig(cfg) paginator := redshiftserverless.NewListSnapshotsPaginator(client, &redshiftserverless.ListSnapshotsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -482,7 +483,7 @@ func RedshiftServerlessSnapshot(ctx context.Context, cfg aws.Config, stream *Str for _, v := range page.Snapshots { resource, err := redshiftServerlessSnapshotHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -502,7 +503,7 @@ func RedshiftServerlessSnapshot(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func redshiftServerlessSnapshotHandle(ctx context.Context, cfg aws.Config, v types2.Snapshot) (Resource, error) { +func redshiftServerlessSnapshotHandle(ctx context.Context, cfg aws.Config, v types2.Snapshot) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := redshiftserverless.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &redshiftserverless.ListTagsForResourceInput{ @@ -510,12 +511,12 @@ func redshiftServerlessSnapshotHandle(ctx context.Context, cfg aws.Config, v typ }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.NamespaceArn, Name: *v.NamespaceName, @@ -526,9 +527,9 @@ func redshiftServerlessSnapshotHandle(ctx context.Context, cfg aws.Config, v typ } return resource, nil } -func GetRedshiftServerlessSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRedshiftServerlessSnapshot(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { snapshot := fields["name"] - var values []Resource + var values []models.Resource client := redshiftserverless.NewFromConfig(cfg) out, err := client.GetSnapshot(ctx, &redshiftserverless.GetSnapshotInput{ @@ -542,7 +543,7 @@ func GetRedshiftServerlessSnapshot(ctx context.Context, cfg aws.Config, fields m } resource, err := redshiftServerlessSnapshotHandle(ctx, cfg, *out.Snapshot) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -554,12 +555,12 @@ func GetRedshiftServerlessSnapshot(ctx context.Context, cfg aws.Config, fields m return values, nil } -func RedshiftServerlessWorkgroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftServerlessWorkgroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := redshiftserverless.NewFromConfig(cfg) paginator := redshiftserverless.NewListWorkgroupsPaginator(client, &redshiftserverless.ListWorkgroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -574,7 +575,7 @@ func RedshiftServerlessWorkgroup(ctx context.Context, cfg aws.Config, stream *St return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.WorkgroupArn, Name: *v.WorkgroupName, @@ -596,11 +597,11 @@ func RedshiftServerlessWorkgroup(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func RedshiftSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func RedshiftSubnetGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := redshift.NewFromConfig(cfg) paginator := redshift.NewDescribeClusterSubnetGroupsPaginator(client, &redshift.DescribeClusterSubnetGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -621,10 +622,10 @@ func RedshiftSubnetGroup(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func redshiftSubnetGroupHandle(ctx context.Context, clusterSubnetGroup types.ClusterSubnetGroup) Resource { +func redshiftSubnetGroupHandle(ctx context.Context, clusterSubnetGroup types.ClusterSubnetGroup) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:redshift:%s:%s:subnetgroup:%s", describeCtx.Partition, describeCtx.OGRegion, describeCtx.AccountID, *clusterSubnetGroup.ClusterSubnetGroupName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *clusterSubnetGroup.ClusterSubnetGroupName, ARN: arn, @@ -634,7 +635,7 @@ func redshiftSubnetGroupHandle(ctx context.Context, clusterSubnetGroup types.Clu } return resource } -func GetRedshiftSubnetGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRedshiftSubnetGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { ClusterSubnetGroupName := fields["name"] client := redshift.NewFromConfig(cfg) @@ -648,7 +649,7 @@ func GetRedshiftSubnetGroup(ctx context.Context, cfg aws.Config, fields map[stri return nil, err } - var values []Resource + var values []models.Resource for _, clusterSubnetGroup := range clusterSubnets.ClusterSubnetGroups { values = append(values, redshiftSubnetGroupHandle(ctx, clusterSubnetGroup)) } diff --git a/provider/describer/resource.go b/provider/describer/resource.go index af0c9674..51f808fb 100755 --- a/provider/describer/resource.go +++ b/provider/describer/resource.go @@ -4,8 +4,6 @@ import ( "strings" ) -type StreamSender func(Resource) error - type Resource struct { // ARN uniquely identifies an AWS resource across regions, accounts and types. ARN string @@ -21,14 +19,6 @@ type Resource struct { Type string } -func (r Resource) UniqueID() string { - if r.ARN != "" { - return r.ARN - } - - return CompositeID(r.Partition, r.Region, r.Account, r.Type, r.ID) -} - func CompositeID(list ...string) string { normList := make([]string, 0, len(list)) for _, v := range list { diff --git a/provider/describer/resource_explorer.go b/provider/describer/resource_explorer.go index 61c9d65d..334f60b1 100755 --- a/provider/describer/resource_explorer.go +++ b/provider/describer/resource_explorer.go @@ -2,18 +2,19 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2" "github.com/opengovern/og-describer-aws/provider/model" ) -func ResourceExplorerIndex(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ResourceExplorerIndex(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := resourceexplorer2.NewFromConfig(cfg) paginator := resourceexplorer2.NewListIndexesPaginator(client, &resourceexplorer2.ListIndexesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -21,7 +22,7 @@ func ResourceExplorerIndex(ctx context.Context, cfg aws.Config, stream *StreamSe } for _, v := range page.Indexes { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Arn, @@ -42,12 +43,12 @@ func ResourceExplorerIndex(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func ResourceExplorer2SupportedResourceType(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ResourceExplorer2SupportedResourceType(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := resourceexplorer2.NewFromConfig(cfg) paginator := resourceexplorer2.NewListSupportedResourceTypesPaginator(client, &resourceexplorer2.ListSupportedResourceTypesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -55,7 +56,7 @@ func ResourceExplorer2SupportedResourceType(ctx context.Context, cfg aws.Config, } for _, v := range page.ResourceTypes { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *v.ResourceType, Description: model.ResourceExplorer2SupportedResourceTypeDescription{ diff --git a/provider/describer/resource_group.go b/provider/describer/resource_group.go index 22d3b3b1..a6b467da 100644 --- a/provider/describer/resource_group.go +++ b/provider/describer/resource_group.go @@ -2,18 +2,19 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/resourcegroups" "github.com/opengovern/og-describer-aws/provider/model" ) -func ResourceGroups(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ResourceGroups(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := resourcegroups.NewFromConfig(cfg) paginator := resourcegroups.NewListGroupsPaginator(client, &resourcegroups.ListGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -31,7 +32,7 @@ func ResourceGroups(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.GroupArn, Name: *v.GroupName, diff --git a/provider/describer/resource_name.go b/provider/describer/resource_name.go deleted file mode 100644 index 0b4a866e..00000000 --- a/provider/describer/resource_name.go +++ /dev/null @@ -1,5 +0,0 @@ -package describer - -// TODO -// We need to implement the Describe function for the resource -// Also Import Models from the provider package diff --git a/provider/describer/route53.go b/provider/describer/route53.go index cf2c6c73..d3d8adf7 100755 --- a/provider/describer/route53.go +++ b/provider/describer/route53.go @@ -7,6 +7,7 @@ import ( "strings" types3 "github.com/aws/aws-sdk-go-v2/service/route53domains/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/service/route53domains" "github.com/aws/smithy-go" @@ -19,11 +20,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func Route53HealthCheck(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53HealthCheck(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListHealthChecks(ctx, &route53.ListHealthChecksInput{Marker: prevToken}) if err != nil { @@ -58,7 +59,7 @@ func Route53HealthCheck(ctx context.Context, cfg aws.Config, stream *StreamSende return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Id, Description: model.Route53HealthCheckDescription{ @@ -89,10 +90,10 @@ func Route53HealthCheck(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func Route53HostedZone(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53HostedZone(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := route53.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListHostedZones(ctx, &route53.ListHostedZonesInput{Marker: prevToken}) if err != nil { @@ -126,7 +127,7 @@ func Route53HostedZone(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func route53HostedZoneHandle(ctx context.Context, cfg aws.Config, v types.HostedZone) (Resource, error) { +func route53HostedZoneHandle(ctx context.Context, cfg aws.Config, v types.HostedZone) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53.NewFromConfig(cfg) @@ -139,7 +140,7 @@ func route53HostedZoneHandle(ctx context.Context, cfg aws.Config, v types.Hosted }) if err != nil { if !isErr(err, "NoSuchHostedZone") { - return Resource{}, err + return models.Resource{}, err } queryLoggingConfigs = &route53.ListQueryLoggingConfigsOutput{} } @@ -150,7 +151,7 @@ func route53HostedZoneHandle(ctx context.Context, cfg aws.Config, v types.Hosted }) if err != nil { if !isErr(err, "NoSuchHostedZone") { - return Resource{}, err + return models.Resource{}, err } limit = &route53.GetHostedZoneLimitOutput{} } @@ -162,7 +163,7 @@ func route53HostedZoneHandle(ctx context.Context, cfg aws.Config, v types.Hosted }) if err != nil { if !isErr(err, "NoSuchHostedZone") && !isErr(err, "AccessDenied") { - return Resource{}, err + return models.Resource{}, err } dnsSec = &route53.GetDNSSECOutput{} } @@ -174,14 +175,14 @@ func route53HostedZoneHandle(ctx context.Context, cfg aws.Config, v types.Hosted }) if err != nil { if !isErr(err, "NoSuchHostedZone") { - return Resource{}, err + return models.Resource{}, err } tags = &route53.ListTagsForResourceOutput{ ResourceTagSet: &types.ResourceTagSet{}, } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.Name, @@ -196,11 +197,11 @@ func route53HostedZoneHandle(ctx context.Context, cfg aws.Config, v types.Hosted } return resource, nil } -func GetRoute53HostedZone(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRoute53HostedZone(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { hostedZoneID := fields["hostedZoneId"] client := route53.NewFromConfig(cfg) - var values []Resource + var values []models.Resource out, err := client.GetHostedZone(ctx, &route53.GetHostedZoneInput{Id: &hostedZoneID}) if err != nil { return nil, err @@ -217,7 +218,7 @@ func GetRoute53HostedZone(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func Route53DNSSEC(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53DNSSEC(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) zones, err := Route53HostedZone(ctx, cfg, nil) if err != nil { @@ -226,7 +227,7 @@ func Route53DNSSEC(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ client := route53.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, zone := range zones { id := zone.Description.(types.HostedZone).Id v, err := client.GetDNSSEC(ctx, &route53.GetDNSSECInput{ @@ -236,7 +237,7 @@ func Route53DNSSEC(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *id, // Unique per HostedZone Name: *id, @@ -255,7 +256,7 @@ func Route53DNSSEC(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func Route53RecordSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53RecordSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) zones, err := Route53HostedZone(ctx, cfg, nil) if err != nil { @@ -264,7 +265,7 @@ func Route53RecordSet(ctx context.Context, cfg aws.Config, stream *StreamSender) client := route53.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, zone := range zones { id := zone.Description.(types.HostedZone).Id var prevType types.RRType @@ -279,7 +280,7 @@ func Route53RecordSet(ctx context.Context, cfg aws.Config, stream *StreamSender) } for _, v := range output.ResourceRecordSets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: CompositeID(*id, *v.Name), Name: *v.Name, @@ -305,12 +306,12 @@ func Route53RecordSet(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func Route53ResolverFirewallDomainList(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverFirewallDomainList(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListFirewallDomainListsPaginator(client, &route53resolver.ListFirewallDomainListsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -318,7 +319,7 @@ func Route53ResolverFirewallDomainList(ctx context.Context, cfg aws.Config, stre } for _, v := range page.FirewallDomainLists { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, @@ -337,12 +338,12 @@ func Route53ResolverFirewallDomainList(ctx context.Context, cfg aws.Config, stre return values, nil } -func Route53ResolverFirewallRuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverFirewallRuleGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListFirewallRuleGroupsPaginator(client, &route53resolver.ListFirewallRuleGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -350,7 +351,7 @@ func Route53ResolverFirewallRuleGroup(ctx context.Context, cfg aws.Config, strea } for _, v := range page.FirewallRuleGroups { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, @@ -369,12 +370,12 @@ func Route53ResolverFirewallRuleGroup(ctx context.Context, cfg aws.Config, strea return values, nil } -func Route53ResolverFirewallRuleGroupAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverFirewallRuleGroupAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListFirewallRuleGroupAssociationsPaginator(client, &route53resolver.ListFirewallRuleGroupAssociationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -382,7 +383,7 @@ func Route53ResolverFirewallRuleGroupAssociation(ctx context.Context, cfg aws.Co } for _, v := range page.FirewallRuleGroupAssociations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, @@ -401,7 +402,7 @@ func Route53ResolverFirewallRuleGroupAssociation(ctx context.Context, cfg aws.Co return values, nil } -func Route53ResolverResolverDNSSECConfig(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverResolverDNSSECConfig(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) vpcs, err := EC2VPC(ctx, cfg, nil) if err != nil { @@ -410,7 +411,7 @@ func Route53ResolverResolverDNSSECConfig(ctx context.Context, cfg aws.Config, st client := route53resolver.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, vpc := range vpcs { v, err := client.GetResolverDnssecConfig(ctx, &route53resolver.GetResolverDnssecConfigInput{ ResourceId: vpc.Description.(model.EC2VpcDescription).Vpc.VpcId, @@ -419,7 +420,7 @@ func Route53ResolverResolverDNSSECConfig(ctx context.Context, cfg aws.Config, st return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ResolverDNSSECConfig.Id, Name: *v.ResolverDNSSECConfig.Id, @@ -437,12 +438,12 @@ func Route53ResolverResolverDNSSECConfig(ctx context.Context, cfg aws.Config, st return values, nil } -func Route53ResolverResolverQueryLoggingConfig(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverResolverQueryLoggingConfig(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListResolverQueryLogConfigsPaginator(client, &route53resolver.ListResolverQueryLogConfigsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -450,7 +451,7 @@ func Route53ResolverResolverQueryLoggingConfig(ctx context.Context, cfg aws.Conf } for _, v := range page.ResolverQueryLogConfigs { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, @@ -469,12 +470,12 @@ func Route53ResolverResolverQueryLoggingConfig(ctx context.Context, cfg aws.Conf return values, nil } -func Route53ResolverResolverQueryLoggingConfigAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverResolverQueryLoggingConfigAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListResolverQueryLogConfigAssociationsPaginator(client, &route53resolver.ListResolverQueryLogConfigAssociationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -482,7 +483,7 @@ func Route53ResolverResolverQueryLoggingConfigAssociation(ctx context.Context, c } for _, v := range page.ResolverQueryLogConfigAssociations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Id, Name: *v.Id, @@ -501,12 +502,12 @@ func Route53ResolverResolverQueryLoggingConfigAssociation(ctx context.Context, c return values, nil } -func Route53ResolverResolverRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverResolverRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListResolverRulesPaginator(client, &route53resolver.ListResolverRulesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -544,7 +545,7 @@ func Route53ResolverResolverRule(ctx context.Context, cfg aws.Config, stream *St return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.Name, @@ -567,11 +568,11 @@ func Route53ResolverResolverRule(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func Route53ResolverResolverEndpoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverResolverEndpoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListResolverEndpointsPaginator(client, &route53resolver.ListResolverEndpointsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -592,7 +593,7 @@ func Route53ResolverResolverEndpoint(ctx context.Context, cfg aws.Config, stream } return values, nil } -func route53ResolverResolverEndpointHandle(ctx context.Context, cfg aws.Config, resolverEndpoint resolvertypes.ResolverEndpoint) Resource { +func route53ResolverResolverEndpointHandle(ctx context.Context, cfg aws.Config, resolverEndpoint resolvertypes.ResolverEndpoint) models.Resource { describeCtx := GetDescribeContext(ctx) client := route53resolver.NewFromConfig(cfg) @@ -610,7 +611,7 @@ func route53ResolverResolverEndpointHandle(ctx context.Context, cfg aws.Config, tags = &route53resolver.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *resolverEndpoint.Arn, Name: *resolverEndpoint.Name, @@ -623,10 +624,10 @@ func route53ResolverResolverEndpointHandle(ctx context.Context, cfg aws.Config, } return resource } -func GetRoute53ResolverResolverEndpoint(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRoute53ResolverResolverEndpoint(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { resolverEndpointId := fields["id"] client := route53resolver.NewFromConfig(cfg) - var values []Resource + var values []models.Resource out, err := client.GetResolverEndpoint(ctx, &route53resolver.GetResolverEndpointInput{ ResolverEndpointId: &resolverEndpointId, @@ -640,12 +641,12 @@ func GetRoute53ResolverResolverEndpoint(ctx context.Context, cfg aws.Config, fie return values, nil } -func Route53ResolverResolverRuleAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverResolverRuleAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListResolverRuleAssociationsPaginator(client, &route53resolver.ListResolverRuleAssociationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -653,7 +654,7 @@ func Route53ResolverResolverRuleAssociation(ctx context.Context, cfg aws.Config, } for _, v := range page.ResolverRuleAssociations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Id, Name: *v.Name, @@ -672,11 +673,11 @@ func Route53ResolverResolverRuleAssociation(ctx context.Context, cfg aws.Config, return values, nil } -func Route53Domain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53Domain(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := route53domains.NewFromConfig(cfg) paginator := route53domains.NewListDomainsPaginator(client, &route53domains.ListDomainsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -699,14 +700,14 @@ func Route53Domain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ } return values, nil } -func Route53DomainHandle(ctx context.Context, cfg aws.Config, v types3.DomainSummary) (Resource, error) { +func Route53DomainHandle(ctx context.Context, cfg aws.Config, v types3.DomainSummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53domains.NewFromConfig(cfg) domain, err := client.GetDomainDetail(ctx, &route53domains.GetDomainDetailInput{ DomainName: v.DomainName, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } tags, err := client.ListTagsForDomain(ctx, &route53domains.ListTagsForDomainInput{ @@ -717,7 +718,7 @@ func Route53DomainHandle(ctx context.Context, cfg aws.Config, v types3.DomainSum } arn := fmt.Sprintf("arn:%s:route53domains:::domain/%s", describeCtx.Partition, *v.DomainName) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *domain.DomainName, ARN: arn, @@ -729,7 +730,7 @@ func Route53DomainHandle(ctx context.Context, cfg aws.Config, v types3.DomainSum } return resource, nil } -func GetRoute53Domain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRoute53Domain(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { domainName := fields["name"] client := route53domains.NewFromConfig(cfg) @@ -741,7 +742,7 @@ func GetRoute53Domain(ctx context.Context, cfg aws.Config, fields map[string]str return nil, err } - var values []Resource + var values []models.Resource for _, v := range list.Domains { if *v.DomainName != domainName { continue @@ -756,10 +757,10 @@ func GetRoute53Domain(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func Route53Record(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53Record(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := route53.NewFromConfig(cfg) paginator := route53.NewListHostedZonesPaginator(client, &route53.ListHostedZonesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -798,10 +799,10 @@ func Route53Record(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func route53RecordHandle(ctx context.Context, record types.ResourceRecordSet, hostedZoneId string) Resource { +func route53RecordHandle(ctx context.Context, record types.ResourceRecordSet, hostedZoneId string) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:route53:::hostedzone/%s/recordset/%s/%s", describeCtx.Partition, hostedZoneId, *record.Name, record.Type) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *record.Name, ARN: arn, @@ -812,7 +813,7 @@ func route53RecordHandle(ctx context.Context, record types.ResourceRecordSet, ho } return resource } -func GetRoute53Record(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRoute53Record(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] client := route53.NewFromConfig(cfg) @@ -836,7 +837,7 @@ func GetRoute53Record(ctx context.Context, cfg aws.Config, fields map[string]str return nil, err } - var values []Resource + var values []models.Resource for _, record := range list.ResourceRecordSets { resource := route53RecordHandle(ctx, record, *hostedZone.HostedZone.Id) @@ -846,9 +847,9 @@ func GetRoute53Record(ctx context.Context, cfg aws.Config, fields map[string]str return values, nil } -func Route53TrafficPolicy(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53TrafficPolicy(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := route53.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { policies, err := client.ListTrafficPolicies(ctx, &route53.ListTrafficPoliciesInput{ TrafficPolicyIdMarker: prevToken, @@ -881,7 +882,7 @@ func Route53TrafficPolicy(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func route53TrafficPolicyHandle(ctx context.Context, cfg aws.Config, policySummary types.TrafficPolicySummary) (Resource, error) { +func route53TrafficPolicyHandle(ctx context.Context, cfg aws.Config, policySummary types.TrafficPolicySummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) @@ -891,11 +892,11 @@ func route53TrafficPolicyHandle(ctx context.Context, cfg aws.Config, policySumma Version: policySummary.LatestVersion, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } arn := fmt.Sprintf("arn:%s:route53::%s:trafficpolicy/%s/%s", describeCtx.Partition, describeCtx.AccountID, *policy.TrafficPolicy.Id, string(*policy.TrafficPolicy.Version)) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *policy.TrafficPolicy.Name, ID: *policy.TrafficPolicy.Id, @@ -906,7 +907,7 @@ func route53TrafficPolicyHandle(ctx context.Context, cfg aws.Config, policySumma } return resource, nil } -func GetRoute53TrafficPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRoute53TrafficPolicy(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] client := route53.NewFromConfig(cfg) @@ -918,7 +919,7 @@ func GetRoute53TrafficPolicy(ctx context.Context, cfg aws.Config, fields map[str return nil, err } - var values []Resource + var values []models.Resource for _, policySummary := range list.TrafficPolicySummaries { if *policySummary.Id != id { continue @@ -932,9 +933,9 @@ func GetRoute53TrafficPolicy(ctx context.Context, cfg aws.Config, fields map[str return values, nil } -func Route53TrafficPolicyInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53TrafficPolicyInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := route53.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { policies, err := client.ListTrafficPolicyInstances(ctx, &route53.ListTrafficPolicyInstancesInput{ TrafficPolicyInstanceNameMarker: prevToken, @@ -964,10 +965,10 @@ func Route53TrafficPolicyInstance(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func route53TrafficPolicyInstanceHandle(ctx context.Context, policyInstance types.TrafficPolicyInstance) Resource { +func route53TrafficPolicyInstanceHandle(ctx context.Context, policyInstance types.TrafficPolicyInstance) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:route53::%s:trafficpolicyinstance/%s", describeCtx.Partition, describeCtx.AccountID, *policyInstance.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *policyInstance.Name, ID: *policyInstance.Id, @@ -978,10 +979,10 @@ func route53TrafficPolicyInstanceHandle(ctx context.Context, policyInstance type } return resource } -func GetRoute53TrafficPolicyInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRoute53TrafficPolicyInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] client := route53.NewFromConfig(cfg) - var values []Resource + var values []models.Resource trafficPolicy, err := client.GetTrafficPolicyInstance(ctx, &route53.GetTrafficPolicyInstanceInput{ Id: &id, @@ -998,12 +999,12 @@ func GetRoute53TrafficPolicyInstance(ctx context.Context, cfg aws.Config, fields return values, nil } -func Route53QueryLog(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53QueryLog(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := route53.NewFromConfig(cfg) paginator := route53.NewListQueryLoggingConfigsPaginator(client, &route53.ListQueryLoggingConfigsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1013,7 +1014,7 @@ func Route53QueryLog(ctx context.Context, cfg aws.Config, stream *StreamSender) for _, v := range page.QueryLoggingConfigs { arn := fmt.Sprintf("arn:%s:route53:::query-log/%s/%s", describeCtx.Partition, *v.HostedZoneId, *v.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Id, ARN: arn, @@ -1034,11 +1035,11 @@ func Route53QueryLog(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func Route53ResolverQueryLogConfig(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func Route53ResolverQueryLogConfig(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := route53resolver.NewFromConfig(cfg) paginator := route53resolver.NewListResolverQueryLogConfigsPaginator(client, &route53resolver.ListResolverQueryLogConfigsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -1059,10 +1060,10 @@ func Route53ResolverQueryLogConfig(ctx context.Context, cfg aws.Config, stream * } return values, nil } -func route53ResolverQueryLogConfigHandle(ctx context.Context, cfg aws.Config, queryLogConfig resolvertypes.ResolverQueryLogConfig) Resource { +func route53ResolverQueryLogConfigHandle(ctx context.Context, cfg aws.Config, queryLogConfig resolvertypes.ResolverQueryLogConfig) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *queryLogConfig.Arn, Name: *queryLogConfig.Name, @@ -1073,10 +1074,10 @@ func route53ResolverQueryLogConfigHandle(ctx context.Context, cfg aws.Config, qu } return resource } -func GetRoute53ResolverQueryLogConfig(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetRoute53ResolverQueryLogConfig(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { id := fields["id"] client := route53resolver.NewFromConfig(cfg) - var values []Resource + var values []models.Resource out, err := client.GetResolverQueryLogConfig(ctx, &route53resolver.GetResolverQueryLogConfigInput{ ResolverQueryLogConfigId: &id, diff --git a/provider/describer/s3.go b/provider/describer/s3.go index 451829ce..d4fada79 100755 --- a/provider/describer/s3.go +++ b/provider/describer/s3.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -27,24 +28,17 @@ const ( s3BucketNoOfWorkers = 8 ) -type s3bucketResult struct { - Bucket types.Bucket - Resource Resource - Region string - Err error -} - // S3Bucket describe S3 buckets. // ListBuckets returns buckets in all regions. However, this function categorizes the buckets based // on their location constaint, aka the regions they reside in. -func S3Bucket(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func S3Bucket(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := s3.NewFromConfig(cfg) output, err := client.ListBuckets(ctx, &s3.ListBucketsInput{}) if err != nil { return nil, fmt.Errorf("error listing buckets: %w", err) } - var values []Resource + var values []models.Resource for _, bucket := range output.Buckets { region, err := getBucketLocation(ctx, client, bucket) @@ -72,10 +66,10 @@ func S3Bucket(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso } return values, nil } -func s3BucketHandle(ctx context.Context, region string, desc *model.S3BucketDescription, bucket types.Bucket) Resource { +func s3BucketHandle(ctx context.Context, region string, desc *model.S3BucketDescription, bucket types.Bucket) models.Resource { describeCtx := GetDescribeContext(ctx) arn := "arn:" + describeCtx.Partition + ":s3:::" + *bucket.Name - resource := Resource{ + resource := models.Resource{ Region: region, ARN: arn, Name: *bucket.Name, @@ -83,7 +77,7 @@ func s3BucketHandle(ctx context.Context, region string, desc *model.S3BucketDesc } return resource } -func GetS3Bucket(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetS3Bucket(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { bucketName := fields["buketName"] client := s3.NewFromConfig(cfg) @@ -92,7 +86,7 @@ func GetS3Bucket(ctx context.Context, cfg aws.Config, fields map[string]string) return nil, fmt.Errorf("error listing buckets: %w", err) } - var values []Resource + var values []models.Resource for _, bucket := range output.Buckets { if *bucket.Name != bucketName { @@ -418,7 +412,7 @@ func isErr(err error, code string) bool { return errors.As(err, &ae) && ae.ErrorCode() == code } -func S3AccessPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func S3AccessPoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) stsClient := sts.NewFromConfig(cfg) output, err := stsClient.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) @@ -431,7 +425,7 @@ func S3AccessPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ AccountId: output.Account, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -472,7 +466,7 @@ func S3AccessPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.AccessPointArn, Name: *v.Name, @@ -494,7 +488,7 @@ func S3AccessPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func S3StorageLens(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func S3StorageLens(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) stsClient := sts.NewFromConfig(cfg) output, err := stsClient.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) @@ -507,7 +501,7 @@ func S3StorageLens(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ AccountId: output.Account, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -515,7 +509,7 @@ func S3StorageLens(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ } for _, v := range page.StorageLensConfigurationList { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.StorageLensArn, Name: *v.Id, @@ -534,7 +528,7 @@ func S3StorageLens(ctx context.Context, cfg aws.Config, stream *StreamSender) ([ return values, nil } -func S3AccountSetting(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func S3AccountSetting(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) accountId, err := STSAccount(ctx, cfg) if err != nil { @@ -560,8 +554,8 @@ func S3AccountSetting(ctx context.Context, cfg aws.Config, stream *StreamSender) } } - var values []Resource - resource := Resource{ + var values []models.Resource + resource := models.Resource{ Region: describeCtx.OGRegion, // No ARN or ID. Account level setting Name: accountId + " S3 Account Setting", @@ -580,14 +574,14 @@ func S3AccountSetting(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func S3Object(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func S3Object(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := s3.NewFromConfig(cfg) buckets, err := client.ListBuckets(ctx, &s3.ListBucketsInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, bucket := range buckets.Buckets { region, err := getBucketLocation(ctx, client, bucket) if err != nil { @@ -636,7 +630,7 @@ func S3Object(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return nil, err } - resource := Resource{ + resource := models.Resource{ Region: region, ARN: arn, Description: model.S3ObjectDescription{ @@ -661,13 +655,13 @@ func S3Object(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func S3BucketIntelligentTieringConfiguration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func S3BucketIntelligentTieringConfiguration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := s3.NewFromConfig(cfg) buckets, err := client.ListBuckets(ctx, &s3.ListBucketsInput{}) if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, bucket := range buckets.Buckets { region, err := getBucketLocation(ctx, client, bucket) if err != nil { @@ -681,7 +675,7 @@ func S3BucketIntelligentTieringConfiguration(ctx context.Context, cfg aws.Config return nil, err } for _, v := range conf.IntelligentTieringConfigurationList { - resource := Resource{ + resource := models.Resource{ Region: region, ID: *v.Id, Description: model.S3BucketIntelligentTieringConfigurationDescription{ @@ -702,7 +696,7 @@ func S3BucketIntelligentTieringConfiguration(ctx context.Context, cfg aws.Config return values, nil } -func S3MultiRegionAccessPoint(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func S3MultiRegionAccessPoint(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) accountId, err := STSAccount(ctx, cfg) if err != nil { @@ -715,7 +709,7 @@ func S3MultiRegionAccessPoint(ctx context.Context, cfg aws.Config, stream *Strea } paginator := s3control.NewListMultiRegionAccessPointsPaginator(client, input) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -727,7 +721,7 @@ func S3MultiRegionAccessPoint(ctx context.Context, cfg aws.Config, stream *Strea for _, report := range page.AccessPoints { arn := "arn:" + describeCtx.Partition + ":s3::" + accountId + ":accesspoint/" + *report.Name - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *report.Name, diff --git a/provider/describer/sagemaker.go b/provider/describer/sagemaker.go index 791cf020..a35cd3b5 100755 --- a/provider/describer/sagemaker.go +++ b/provider/describer/sagemaker.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sagemaker" @@ -9,11 +10,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func SageMakerEndpointConfiguration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SageMakerEndpointConfiguration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := sagemaker.NewFromConfig(cfg) paginator := sagemaker.NewListEndpointConfigsPaginator(client, &sagemaker.ListEndpointConfigsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -33,7 +34,7 @@ func SageMakerEndpointConfiguration(ctx context.Context, cfg aws.Config, stream } resource, err := sageMakerEndpointConfigurationHandle(ctx, cfg, item.EndpointConfigArn, out) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -52,7 +53,7 @@ func SageMakerEndpointConfiguration(ctx context.Context, cfg aws.Config, stream } return values, nil } -func sageMakerEndpointConfigurationHandle(ctx context.Context, cfg aws.Config, endpointConfigArn *string, out *sagemaker.DescribeEndpointConfigOutput) (Resource, error) { +func sageMakerEndpointConfigurationHandle(ctx context.Context, cfg aws.Config, endpointConfigArn *string, out *sagemaker.DescribeEndpointConfigOutput) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sagemaker.NewFromConfig(cfg) @@ -61,12 +62,12 @@ func sageMakerEndpointConfigurationHandle(ctx context.Context, cfg aws.Config, e }) if err != nil { if isErr(err, "ListTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *out.EndpointConfigArn, Name: *out.EndpointConfigName, @@ -77,9 +78,9 @@ func sageMakerEndpointConfigurationHandle(ctx context.Context, cfg aws.Config, e } return resource, nil } -func GetMakerEndpointConfigurationHandle(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetMakerEndpointConfigurationHandle(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { endpointConfigName := fields["name"] - var values []Resource + var values []models.Resource client := sagemaker.NewFromConfig(cfg) out, err := client.DescribeEndpointConfig(ctx, &sagemaker.DescribeEndpointConfigInput{ EndpointConfigName: &endpointConfigName, @@ -92,7 +93,7 @@ func GetMakerEndpointConfigurationHandle(ctx context.Context, cfg aws.Config, fi } resource, err := sageMakerEndpointConfigurationHandle(ctx, cfg, out.EndpointConfigArn, out) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -104,11 +105,11 @@ func GetMakerEndpointConfigurationHandle(ctx context.Context, cfg aws.Config, fi return values, nil } -func SageMakerApp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SageMakerApp(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sagemaker.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := sagemaker.NewListDomainsPaginator(client, &sagemaker.ListDomainsInput{}) for paginator.HasMorePages() { output, err := paginator.NextPage(ctx) @@ -140,7 +141,7 @@ func SageMakerApp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *data.AppArn, Name: *data.AppName, @@ -163,11 +164,11 @@ func SageMakerApp(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func SageMakerDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SageMakerDomain(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sagemaker.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := sagemaker.NewListDomainsPaginator(client, &sagemaker.ListDomainsInput{}) for paginator.HasMorePages() { output, err := paginator.NextPage(ctx) @@ -202,7 +203,7 @@ func SageMakerDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *domain.DomainArn, Name: *domain.DomainName, @@ -224,11 +225,11 @@ func SageMakerDomain(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func SageMakerNotebookInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SageMakerNotebookInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := sagemaker.NewFromConfig(cfg) paginator := sagemaker.NewListNotebookInstancesPaginator(client, &sagemaker.ListNotebookInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -247,7 +248,7 @@ func SageMakerNotebookInstance(ctx context.Context, cfg aws.Config, stream *Stre } resource, err := sageMakerNotebookInstanceHandle(ctx, cfg, out) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -267,7 +268,7 @@ func SageMakerNotebookInstance(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func sageMakerNotebookInstanceHandle(ctx context.Context, cfg aws.Config, out *sagemaker.DescribeNotebookInstanceOutput) (Resource, error) { +func sageMakerNotebookInstanceHandle(ctx context.Context, cfg aws.Config, out *sagemaker.DescribeNotebookInstanceOutput) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sagemaker.NewFromConfig(cfg) @@ -276,12 +277,12 @@ func sageMakerNotebookInstanceHandle(ctx context.Context, cfg aws.Config, out *s }) if err != nil { if isErr(err, "ListTagsNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *out.NotebookInstanceArn, Name: *out.NotebookInstanceName, @@ -292,9 +293,9 @@ func sageMakerNotebookInstanceHandle(ctx context.Context, cfg aws.Config, out *s } return resource, nil } -func GetSageMakerNotebookInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSageMakerNotebookInstance(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { describeNetbookInstanceName := fields["name"] - var values []Resource + var values []models.Resource client := sagemaker.NewFromConfig(cfg) out, err := client.DescribeNotebookInstance(ctx, &sagemaker.DescribeNotebookInstanceInput{ @@ -308,7 +309,7 @@ func GetSageMakerNotebookInstance(ctx context.Context, cfg aws.Config, fields ma } resource, err := sageMakerNotebookInstanceHandle(ctx, cfg, out) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -320,10 +321,10 @@ func GetSageMakerNotebookInstance(ctx context.Context, cfg aws.Config, fields ma return values, nil } -func SageMakerModel(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SageMakerModel(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := sagemaker.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := sagemaker.NewListModelsPaginator(client, &sagemaker.ListModelsInput{}) for paginator.HasMorePages() { output, err := paginator.NextPage(ctx) @@ -350,7 +351,7 @@ func SageMakerModel(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } return values, nil } -func sageMakerModelHandle(ctx context.Context, cfg aws.Config, sageModel *sagemaker.DescribeModelOutput) Resource { +func sageMakerModelHandle(ctx context.Context, cfg aws.Config, sageModel *sagemaker.DescribeModelOutput) models.Resource { describeCtx := GetDescribeContext(ctx) client := sagemaker.NewFromConfig(cfg) @@ -361,7 +362,7 @@ func sageMakerModelHandle(ctx context.Context, cfg aws.Config, sageModel *sagema tags = &sagemaker.ListTagsOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *sageModel.ModelArn, Name: *sageModel.ModelName, @@ -372,9 +373,9 @@ func sageMakerModelHandle(ctx context.Context, cfg aws.Config, sageModel *sagema } return resource } -func GetSageMakerModel(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSageMakerModel(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { modelName := fields["name"] - var values []Resource + var values []models.Resource client := sagemaker.NewFromConfig(cfg) out, err := client.DescribeModel(ctx, &sagemaker.DescribeModelInput{ @@ -391,11 +392,11 @@ func GetSageMakerModel(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func SageMakerTrainingJob(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SageMakerTrainingJob(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sagemaker.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := sagemaker.NewListTrainingJobsPaginator(client, &sagemaker.ListTrainingJobsInput{}) for paginator.HasMorePages() { output, err := paginator.NextPage(ctx) @@ -418,7 +419,7 @@ func SageMakerTrainingJob(ctx context.Context, cfg aws.Config, stream *StreamSen tags = &sagemaker.ListTagsOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *trainingJob.TrainingJobArn, Name: *trainingJob.TrainingJobName, diff --git a/provider/describer/secretsmanager.go b/provider/describer/secretsmanager.go index d7b8ceed..1f5c2be7 100755 --- a/provider/describer/secretsmanager.go +++ b/provider/describer/secretsmanager.go @@ -2,17 +2,18 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/secretsmanager" "github.com/opengovern/og-describer-aws/provider/model" ) -func SecretsManagerSecret(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecretsManagerSecret(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := secretsmanager.NewFromConfig(cfg) paginator := secretsmanager.NewListSecretsPaginator(client, &secretsmanager.ListSecretsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -36,24 +37,24 @@ func SecretsManagerSecret(ctx context.Context, cfg aws.Config, stream *StreamSen } return values, nil } -func secretsManagerSecretHandle(ctx context.Context, cfg aws.Config, Arn *string, Name *string) (Resource, error) { +func secretsManagerSecretHandle(ctx context.Context, cfg aws.Config, Arn *string, Name *string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := secretsmanager.NewFromConfig(cfg) out, err := client.DescribeSecret(ctx, &secretsmanager.DescribeSecretInput{ SecretId: Arn, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } policy, err := client.GetResourcePolicy(ctx, &secretsmanager.GetResourcePolicyInput{ SecretId: Arn, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *Arn, Name: *Name, @@ -64,9 +65,9 @@ func secretsManagerSecretHandle(ctx context.Context, cfg aws.Config, Arn *string } return resource, nil } -func GetSecretsManagerSecret(ctx context.Context, cfg aws.Config, field map[string]string) ([]Resource, error) { +func GetSecretsManagerSecret(ctx context.Context, cfg aws.Config, field map[string]string) ([]models.Resource, error) { secretId := field["id"] - var values []Resource + var values []models.Resource client := secretsmanager.NewFromConfig(cfg) secretValue, err := client.GetSecretValue(ctx, &secretsmanager.GetSecretValueInput{ diff --git a/provider/describer/securityhub.go b/provider/describer/securityhub.go index 9da3b3a1..a6242375 100755 --- a/provider/describer/securityhub.go +++ b/provider/describer/securityhub.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strconv" "strings" @@ -14,7 +15,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func SecurityHubHub(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubHub(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := securityhub.NewFromConfig(cfg) out, err := client.DescribeHub(ctx, &securityhub.DescribeHubInput{}) if err != nil { @@ -24,7 +25,7 @@ func SecurityHubHub(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return nil, err } - var values []Resource + var values []models.Resource resource, err := securityHubHubHandle(ctx, cfg, out) if err != nil { @@ -41,21 +42,21 @@ func SecurityHubHub(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func securityHubHubHandle(ctx context.Context, cfg aws.Config, out *securityhub.DescribeHubOutput) (Resource, error) { +func securityHubHubHandle(ctx context.Context, cfg aws.Config, out *securityhub.DescribeHubOutput) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := securityhub.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &securityhub.ListTagsForResourceInput{ResourceArn: out.HubArn}) if err != nil { if isErr(err, "InvalidAccessException") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } data, err := client.GetAdministratorAccount(ctx, &securityhub.GetAdministratorAccountInput{}) if err != nil { - return Resource{}, err + return models.Resource{}, err } desc := model.SecurityHubHubDescription{ @@ -65,7 +66,7 @@ func securityHubHubHandle(ctx context.Context, cfg aws.Config, out *securityhub. if data.Administrator != nil { desc.AdministratorAccount = *data.Administrator } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: desc, } @@ -75,9 +76,9 @@ func securityHubHubHandle(ctx context.Context, cfg aws.Config, out *securityhub. } return resource, nil } -func GetSecurityHubHub(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSecurityHubHub(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] - var values []Resource + var values []models.Resource client := securityhub.NewFromConfig(cfg) out, err := client.DescribeHub(ctx, &securityhub.DescribeHubInput{ @@ -98,10 +99,10 @@ func GetSecurityHubHub(ctx context.Context, cfg aws.Config, fields map[string]st return values, nil } -func SecurityHubActionTarget(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubActionTarget(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := securityhub.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := securityhub.NewDescribeActionTargetsPaginator(client, &securityhub.DescribeActionTargetsInput{}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -127,9 +128,9 @@ func SecurityHubActionTarget(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func securityHubActionTargetHandle(ctx context.Context, actionTarget types.ActionTarget) Resource { +func securityHubActionTargetHandle(ctx context.Context, actionTarget types.ActionTarget) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *actionTarget.ActionTargetArn, Name: *actionTarget.Name, @@ -139,7 +140,7 @@ func securityHubActionTargetHandle(ctx context.Context, actionTarget types.Actio } return resource } -func GetSecurityHubActionTarget(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSecurityHubActionTarget(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { actionTargetArn := fields["arn"] client := securityhub.NewFromConfig(cfg) @@ -153,7 +154,7 @@ func GetSecurityHubActionTarget(ctx context.Context, cfg aws.Config, fields map[ return nil, err } - var values []Resource + var values []models.Resource for _, actionTarget := range out.ActionTargets { values = append(values, securityHubActionTargetHandle(ctx, actionTarget)) @@ -162,11 +163,11 @@ func GetSecurityHubActionTarget(ctx context.Context, cfg aws.Config, fields map[ return values, nil } -func SecurityHubFinding(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubFinding(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := securityhub.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := securityhub.NewGetFindingsPaginator(client, &securityhub.GetFindingsInput{}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -178,7 +179,7 @@ func SecurityHubFinding(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, finding := range page.Findings { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *finding.Id, Name: *finding.Title, @@ -199,10 +200,10 @@ func SecurityHubFinding(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func SecurityHubFindingAggregator(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubFindingAggregator(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := securityhub.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := securityhub.NewListFindingAggregatorsPaginator(client, &securityhub.ListFindingAggregatorsInput{}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -218,7 +219,7 @@ func SecurityHubFindingAggregator(ctx context.Context, cfg aws.Config, stream *S if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -235,7 +236,7 @@ func SecurityHubFindingAggregator(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func securityHubFindingAggregatorHandle(ctx context.Context, cfg aws.Config, findingAggregatorArn string) (Resource, error) { +func securityHubFindingAggregatorHandle(ctx context.Context, cfg aws.Config, findingAggregatorArn string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := securityhub.NewFromConfig(cfg) @@ -244,11 +245,11 @@ func securityHubFindingAggregatorHandle(ctx context.Context, cfg aws.Config, fin }) if err != nil { if isErr(err, "InvalidAccessException") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *findingAggregator.FindingAggregatorArn, Description: model.SecurityHubFindingAggregatorDescription{ @@ -257,15 +258,15 @@ func securityHubFindingAggregatorHandle(ctx context.Context, cfg aws.Config, fin } return resource, nil } -func GetSecurityHubFindingAggregator(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSecurityHubFindingAggregator(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] - var values []Resource + var values []models.Resource resource, err := securityHubFindingAggregatorHandle(ctx, cfg, arn) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -274,10 +275,10 @@ func GetSecurityHubFindingAggregator(ctx context.Context, cfg aws.Config, fields return values, nil } -func SecurityHubInsight(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubInsight(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := securityhub.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := securityhub.NewGetInsightsPaginator(client, &securityhub.GetInsightsInput{}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -302,9 +303,9 @@ func SecurityHubInsight(ctx context.Context, cfg aws.Config, stream *StreamSende } return values, nil } -func securityHubInsightHandle(ctx context.Context, insight types.Insight) Resource { +func securityHubInsightHandle(ctx context.Context, insight types.Insight) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *insight.InsightArn, Name: *insight.Name, @@ -314,7 +315,7 @@ func securityHubInsightHandle(ctx context.Context, insight types.Insight) Resour } return resource } -func GetSecurityHubInsight(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSecurityHubInsight(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] client := securityhub.NewFromConfig(cfg) @@ -328,7 +329,7 @@ func GetSecurityHubInsight(ctx context.Context, cfg aws.Config, fields map[strin return nil, err } - var values []Resource + var values []models.Resource for _, insight := range out.Insights { resource := securityHubInsightHandle(ctx, insight) values = append(values, resource) @@ -336,7 +337,7 @@ func GetSecurityHubInsight(ctx context.Context, cfg aws.Config, fields map[strin return values, nil } -func SecurityHubMember(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubMember(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { params := &securityhub.ListMembersInput{ OnlyAssociated: aws.Bool(false), } @@ -368,7 +369,7 @@ func SecurityHubMember(ctx context.Context, cfg aws.Config, stream *StreamSender }) }) - var values []Resource + var values []models.Resource paginator := securityhub.NewListMembersPaginator(client, params, func(o *securityhub.ListMembersPaginatorOptions) { o.StopOnDuplicateToken = true }) @@ -398,9 +399,9 @@ func SecurityHubMember(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func securityHubMemberHandle(ctx context.Context, member types.Member) Resource { +func securityHubMemberHandle(ctx context.Context, member types.Member) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *member.AccountId, Description: model.SecurityHubMemberDescription{ @@ -409,7 +410,7 @@ func securityHubMemberHandle(ctx context.Context, member types.Member) Resource } return resource } -func GetSecurityHubMember(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSecurityHubMember(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { accountId := fields["accountId"] client := securityhub.NewFromConfig(cfg) @@ -423,7 +424,7 @@ func GetSecurityHubMember(ctx context.Context, cfg aws.Config, fields map[string return nil, err } - var values []Resource + var values []models.Resource for _, member := range out.Members { resource := securityHubMemberHandle(ctx, member) values = append(values, resource) @@ -431,11 +432,11 @@ func GetSecurityHubMember(ctx context.Context, cfg aws.Config, fields map[string return values, nil } -func SecurityHubProduct(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubProduct(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := securityhub.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := securityhub.NewDescribeProductsPaginator(client, &securityhub.DescribeProductsInput{}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -447,7 +448,7 @@ func SecurityHubProduct(ctx context.Context, cfg aws.Config, stream *StreamSende } for _, product := range page.Products { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *product.ProductName, ARN: *product.ProductArn, @@ -468,10 +469,10 @@ func SecurityHubProduct(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func SecurityHubStandardsControl(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubStandardsControl(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := securityhub.NewFromConfig(cfg) - var values []Resource + var values []models.Resource subPaginator := securityhub.NewGetEnabledStandardsPaginator(client, &securityhub.GetEnabledStandardsInput{}) for subPaginator.HasMorePages() { @@ -511,9 +512,9 @@ func SecurityHubStandardsControl(ctx context.Context, cfg aws.Config, stream *St } return values, nil } -func securityHubStandardsControlHandle(ctx context.Context, standardsControl types.StandardsControl) Resource { +func securityHubStandardsControlHandle(ctx context.Context, standardsControl types.StandardsControl) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *standardsControl.ControlId, Name: *standardsControl.Title, @@ -524,7 +525,7 @@ func securityHubStandardsControlHandle(ctx context.Context, standardsControl typ } return resource } -func GetSecurityHubStandardsControl(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSecurityHubStandardsControl(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { standardsSubscriptionArn := fields["arn"] client := securityhub.NewFromConfig(cfg) out, err := client.DescribeStandardsControls(ctx, &securityhub.DescribeStandardsControlsInput{ @@ -533,7 +534,7 @@ func GetSecurityHubStandardsControl(ctx context.Context, cfg aws.Config, fields if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Controls { resource := securityHubStandardsControlHandle(ctx, v) values = append(values, resource) @@ -541,10 +542,10 @@ func GetSecurityHubStandardsControl(ctx context.Context, cfg aws.Config, fields return values, nil } -func SecurityHubStandardsSubscription(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityHubStandardsSubscription(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := securityhub.NewFromConfig(cfg) - var values []Resource + var values []models.Resource standardsPaginator := securityhub.NewDescribeStandardsPaginator(client, &securityhub.DescribeStandardsInput{}) standards := make(map[string]types.Standard) for standardsPaginator.HasMorePages() { @@ -584,11 +585,11 @@ func SecurityHubStandardsSubscription(ctx context.Context, cfg aws.Config, strea return values, nil } -func securityHubStandardsSubscriptionHandle(ctx context.Context, standardSub types.StandardsSubscription, standards map[string]types.Standard) Resource { +func securityHubStandardsSubscriptionHandle(ctx context.Context, standardSub types.StandardsSubscription, standards map[string]types.Standard) models.Resource { describeCtx := GetDescribeContext(ctx) standard, _ := standards[*standardSub.StandardsArn] - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *standardSub.StandardsSubscriptionArn, Description: model.SecurityHubStandardsSubscriptionDescription{ @@ -598,11 +599,11 @@ func securityHubStandardsSubscriptionHandle(ctx context.Context, standardSub typ } return resource } -func GetSecurityHubStandardsSubscription(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSecurityHubStandardsSubscription(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { standardsSubscriptionArn := fields["standardsSubscriptionArn"] client := securityhub.NewFromConfig(cfg) - var values []Resource + var values []models.Resource standardsPaginator := securityhub.NewDescribeStandardsPaginator(client, &securityhub.DescribeStandardsInput{}) standards := make(map[string]types.Standard) for standardsPaginator.HasMorePages() { diff --git a/provider/describer/securitylake.go b/provider/describer/securitylake.go index 5a30003a..0086734a 100755 --- a/provider/describer/securitylake.go +++ b/provider/describer/securitylake.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/securitylake" @@ -9,11 +10,11 @@ import ( ) // SecurityLakeDataLake TODO: new sdk version available but a field is missing -func SecurityLakeDataLake(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityLakeDataLake(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := securitylake.NewFromConfig(cfg) - var values []Resource + var values []models.Resource lakes, err := client.ListDataLakes(ctx, &securitylake.ListDataLakesInput{}) if err != nil { if isErr(err, "AccessDeniedException") { @@ -26,7 +27,7 @@ func SecurityLakeDataLake(ctx context.Context, cfg aws.Config, stream *StreamSen if lake.DataLakeArn == nil { continue } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *lake.DataLakeArn, ARN: *lake.DataLakeArn, @@ -46,11 +47,11 @@ func SecurityLakeDataLake(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func SecurityLakeSubscriber(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SecurityLakeSubscriber(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := securitylake.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := securitylake.NewListSubscribersPaginator(client, &securitylake.ListSubscribersInput{}) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -62,7 +63,7 @@ func SecurityLakeSubscriber(ctx context.Context, cfg aws.Config, stream *StreamS } for _, subscriber := range page.Subscribers { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *subscriber.SubscriberName, Description: model.SecurityLakeSubscriberDescription{ diff --git a/provider/describer/serverlessapplicationrepository.go b/provider/describer/serverlessapplicationrepository.go index c6929bda..92223392 100755 --- a/provider/describer/serverlessapplicationrepository.go +++ b/provider/describer/serverlessapplicationrepository.go @@ -2,17 +2,18 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository" "github.com/opengovern/og-describer-aws/provider/model" ) -func ServerlessApplicationRepositoryApplication(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServerlessApplicationRepositoryApplication(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := serverlessapplicationrepository.NewFromConfig(cfg) paginator := serverlessapplicationrepository.NewListApplicationsPaginator(client, &serverlessapplicationrepository.ListApplicationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -37,7 +38,7 @@ func ServerlessApplicationRepositoryApplication(ctx context.Context, cfg aws.Con return values, nil } -func serverlessApplicationRepositoryApplicationHandle(ctx context.Context, cfg aws.Config, applicationId string) (Resource, error) { +func serverlessApplicationRepositoryApplicationHandle(ctx context.Context, cfg aws.Config, applicationId string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := serverlessapplicationrepository.NewFromConfig(cfg) @@ -45,7 +46,7 @@ func serverlessApplicationRepositoryApplicationHandle(ctx context.Context, cfg a ApplicationId: &applicationId, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } policy, err := client.GetApplicationPolicy(ctx, &serverlessapplicationrepository.GetApplicationPolicyInput{ @@ -55,7 +56,7 @@ func serverlessApplicationRepositoryApplicationHandle(ctx context.Context, cfg a policy = &serverlessapplicationrepository.GetApplicationPolicyOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *application.ApplicationId, Name: *application.ApplicationId, @@ -66,10 +67,10 @@ func serverlessApplicationRepositoryApplicationHandle(ctx context.Context, cfg a } return resource, nil } -func GetServerlessApplicationRepositoryApplication(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetServerlessApplicationRepositoryApplication(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { applicationId := fields["applicationId"] - var values []Resource + var values []models.Resource resource, err := serverlessApplicationRepositoryApplicationHandle(ctx, cfg, applicationId) if err != nil { return nil, err diff --git a/provider/describer/serviceCatalog.go b/provider/describer/serviceCatalog.go index 834b862d..f2f62d35 100644 --- a/provider/describer/serviceCatalog.go +++ b/provider/describer/serviceCatalog.go @@ -4,17 +4,18 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/servicecatalog" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/opengovern/og-describer-aws/provider/model" ) -func ServiceCatalogProduct(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceCatalogProduct(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicecatalog.NewFromConfig(cfg) paginator := servicecatalog.NewSearchProductsPaginator(client, &servicecatalog.SearchProductsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -35,7 +36,7 @@ func ServiceCatalogProduct(ctx context.Context, cfg aws.Config, stream *StreamSe if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *item.Id, Name: *item.Name, @@ -57,11 +58,11 @@ func ServiceCatalogProduct(ctx context.Context, cfg aws.Config, stream *StreamSe } return values, nil } -func ServiceCatalogPortfolio(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceCatalogPortfolio(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicecatalog.NewFromConfig(cfg) paginator := servicecatalog.NewListPortfoliosPaginator(client, &servicecatalog.ListPortfoliosInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -71,7 +72,7 @@ func ServiceCatalogPortfolio(ctx context.Context, cfg aws.Config, stream *Stream client.DescribePortfolio(ctx, &servicecatalog.DescribePortfolioInput{ Id: v.Id, }) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Id, Name: *v.ProviderName, diff --git a/provider/describer/serviceDiscovery.go b/provider/describer/serviceDiscovery.go index f33dcd90..94b6792c 100644 --- a/provider/describer/serviceDiscovery.go +++ b/provider/describer/serviceDiscovery.go @@ -2,18 +2,19 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/servicediscovery" "github.com/opengovern/og-describer-aws/provider/model" ) -func ServiceDiscoveryService(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceDiscoveryService(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicediscovery.NewFromConfig(cfg) paginator := servicediscovery.NewListServicesPaginator(client, &servicediscovery.ListServicesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -27,7 +28,7 @@ func ServiceDiscoveryService(ctx context.Context, cfg aws.Config, stream *Stream return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *item.Id, Description: model.ServiceDiscoveryServiceDescription{ @@ -47,12 +48,12 @@ func ServiceDiscoveryService(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func ServiceDiscoveryNamespace(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceDiscoveryNamespace(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicediscovery.NewFromConfig(cfg) paginator := servicediscovery.NewListNamespacesPaginator(client, &servicediscovery.ListNamespacesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -66,7 +67,7 @@ func ServiceDiscoveryNamespace(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Id, Name: *v.Name, @@ -86,11 +87,11 @@ func ServiceDiscoveryNamespace(ctx context.Context, cfg aws.Config, stream *Stre } return values, nil } -func ServiceDiscoveryInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceDiscoveryInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := servicediscovery.NewFromConfig(cfg) paginator := servicediscovery.NewListServicesPaginator(client, &servicediscovery.ListServicesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -115,19 +116,19 @@ func ServiceDiscoveryInstance(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func getServiceDiscoveryInstances(ctx context.Context, cfg aws.Config, id *string) ([]Resource, error) { +func getServiceDiscoveryInstances(ctx context.Context, cfg aws.Config, id *string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicediscovery.NewFromConfig(cfg) paginator := servicediscovery.NewListInstancesPaginator(client, &servicediscovery.ListInstancesInput{ServiceId: id}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } for _, v := range page.Instances { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Id, Name: *v.Id, diff --git a/provider/describer/servicequotas.go b/provider/describer/servicequotas.go index 255ad029..24c92fcb 100755 --- a/provider/describer/servicequotas.go +++ b/provider/describer/servicequotas.go @@ -3,19 +3,20 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/servicequotas" "github.com/opengovern/og-describer-aws/provider/model" ) -func ServiceQuotasService(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceQuotasService(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicequotas.NewFromConfig(cfg) servicesPaginator := servicequotas.NewListServicesPaginator(client, &servicequotas.ListServicesInput{}) - var values []Resource + var values []models.Resource for servicesPaginator.HasMorePages() { servicesPage, err := servicesPaginator.NextPage(ctx) if err != nil { @@ -25,7 +26,7 @@ func ServiceQuotasService(ctx context.Context, cfg aws.Config, stream *StreamSen for _, service := range servicesPage.Services { arn := fmt.Sprintf("arn:%s:servicequotas:%s:%s:%s", describeCtx.Partition, describeCtx.OGRegion, describeCtx.AccountID, *service.ServiceCode) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *service.ServiceName, @@ -47,11 +48,11 @@ func ServiceQuotasService(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func ServiceQuotasDefaultServiceQuota(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceQuotasDefaultServiceQuota(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicequotas.NewFromConfig(cfg) - var values []Resource + var values []models.Resource servicesPaginator := servicequotas.NewListServicesPaginator(client, &servicequotas.ListServicesInput{}) for servicesPaginator.HasMorePages() { servicesPage, err := servicesPaginator.NextPage(ctx) @@ -70,7 +71,7 @@ func ServiceQuotasDefaultServiceQuota(ctx context.Context, cfg aws.Config, strea } for _, quota := range page.Quotas { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *quota.QuotaArn + "--default", Name: *quota.QuotaName, @@ -93,11 +94,11 @@ func ServiceQuotasDefaultServiceQuota(ctx context.Context, cfg aws.Config, strea return values, nil } -func ServiceQuotasServiceQuota(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceQuotasServiceQuota(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicequotas.NewFromConfig(cfg) - var values []Resource + var values []models.Resource servicesPaginator := servicequotas.NewListServicesPaginator(client, &servicequotas.ListServicesInput{}) for servicesPaginator.HasMorePages() { servicesPage, err := servicesPaginator.NextPage(ctx) @@ -122,7 +123,7 @@ func ServiceQuotasServiceQuota(ctx context.Context, cfg aws.Config, stream *Stre if err != nil { tags = &servicequotas.ListTagsForResourceOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *quota.QuotaArn, Name: *quota.QuotaName, @@ -146,11 +147,11 @@ func ServiceQuotasServiceQuota(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func ServiceQuotasServiceQuotaChangeRequest(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ServiceQuotasServiceQuotaChangeRequest(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := servicequotas.NewFromConfig(cfg) - var values []Resource + var values []models.Resource paginator := servicequotas.NewListRequestedServiceQuotaChangeHistoryPaginator(client, &servicequotas.ListRequestedServiceQuotaChangeHistoryInput{}) for paginator.HasMorePages() { @@ -168,7 +169,7 @@ func ServiceQuotasServiceQuotaChangeRequest(ctx context.Context, cfg aws.Config, } arn := fmt.Sprintf("arn:aws:servicequotas:%s:%s:changeRequest/%s", describeCtx.OGRegion, describeCtx.AccountID, *requestedQuota.Id) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *requestedQuota.Id, diff --git a/provider/describer/ses.go b/provider/describer/ses.go index a29ea562..99a49ad0 100755 --- a/provider/describer/ses.go +++ b/provider/describer/ses.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ses" @@ -12,11 +13,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func SESConfigurationSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SESConfigurationSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := sesv2.NewFromConfig(cfg) paginator := sesv2.NewListConfigurationSetsPaginator(client, &sesv2.ListConfigurationSetsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -26,7 +27,7 @@ func SESConfigurationSet(ctx context.Context, cfg aws.Config, stream *StreamSend for _, v := range page.ConfigurationSets { resource, err := sESConfigurationSetHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -46,7 +47,7 @@ func SESConfigurationSet(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func sESConfigurationSetHandle(ctx context.Context, cfg aws.Config, v string) (Resource, error) { +func sESConfigurationSetHandle(ctx context.Context, cfg aws.Config, v string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) sesClient := ses.NewFromConfig(cfg) @@ -54,14 +55,14 @@ func sESConfigurationSetHandle(ctx context.Context, cfg aws.Config, v string) (R output, err := sesClient.DescribeConfigurationSet(ctx, &ses.DescribeConfigurationSetInput{ConfigurationSetName: aws.String(v)}) if err != nil { if isErr(err, "DescribeConfigurationSetNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } arn := fmt.Sprintf("arn:%s:ses:%s:%s:configuration-set/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *output.ConfigurationSet.Name) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *output.ConfigurationSet.Name, @@ -71,12 +72,12 @@ func sESConfigurationSetHandle(ctx context.Context, cfg aws.Config, v string) (R } return resource, nil } -func GetSESConfigurationSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSESConfigurationSet(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { configurationSetName := fields["name"] - var values []Resource + var values []models.Resource resource, err := sESConfigurationSetHandle(ctx, cfg, configurationSetName) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -88,11 +89,11 @@ func GetSESConfigurationSet(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func SESIdentity(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SESIdentity(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ses.NewFromConfig(cfg) paginator := ses.NewListIdentitiesPaginator(client, &ses.ListIdentitiesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -103,7 +104,7 @@ func SESIdentity(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R for _, v := range page.Identities { resource, err := sESIdentityHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -124,11 +125,11 @@ func SESIdentity(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func SESv2EmailIdentities(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SESv2EmailIdentities(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := sesv2.NewFromConfig(cfg) paginator := sesv2.NewListEmailIdentitiesPaginator(client, &sesv2.ListEmailIdentitiesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) @@ -139,7 +140,7 @@ func SESv2EmailIdentities(ctx context.Context, cfg aws.Config, stream *StreamSen for _, v := range page.EmailIdentities { resource, err := sESv2EmailIdentitiesHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -160,7 +161,7 @@ func SESv2EmailIdentities(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func sESv2EmailIdentitiesHandle(ctx context.Context, cfg aws.Config, v sesv2types.IdentityInfo) (Resource, error) { +func sESv2EmailIdentitiesHandle(ctx context.Context, cfg aws.Config, v sesv2types.IdentityInfo) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sesv2.NewFromConfig(cfg) @@ -172,12 +173,12 @@ func sESv2EmailIdentitiesHandle(ctx context.Context, cfg aws.Config, v sesv2type }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.IdentityName, @@ -190,7 +191,7 @@ func sESv2EmailIdentitiesHandle(ctx context.Context, cfg aws.Config, v sesv2type return resource, nil } -func sESIdentityHandle(ctx context.Context, cfg aws.Config, v string) (Resource, error) { +func sESIdentityHandle(ctx context.Context, cfg aws.Config, v string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ses.NewFromConfig(cfg) @@ -202,9 +203,9 @@ func sESIdentityHandle(ctx context.Context, cfg aws.Config, v string) (Resource, }) if err != nil { if isErr(err, "GetIdentityVerificationAttributesNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } notif, err := client.GetIdentityNotificationAttributes(ctx, &ses.GetIdentityNotificationAttributesInput{ @@ -212,9 +213,9 @@ func sESIdentityHandle(ctx context.Context, cfg aws.Config, v string) (Resource, }) if err != nil { if isErr(err, "GetIdentityNotificationAttributesNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } DkimAtrb, err := client.GetIdentityDkimAttributes(ctx, &ses.GetIdentityDkimAttributesInput{ @@ -222,9 +223,9 @@ func sESIdentityHandle(ctx context.Context, cfg aws.Config, v string) (Resource, }) if err != nil { if isErr(err, "GetIdentityDkimAttributesNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } identityMail, err := client.GetIdentityMailFromDomainAttributes(ctx, &ses.GetIdentityMailFromDomainAttributesInput{ @@ -232,12 +233,12 @@ func sESIdentityHandle(ctx context.Context, cfg aws.Config, v string) (Resource, }) if err != nil { if isErr(err, "GetIdentityMailFromDomainAttributesNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: v, @@ -252,7 +253,7 @@ func sESIdentityHandle(ctx context.Context, cfg aws.Config, v string) (Resource, } return resource, nil } -func GetSESIdentity(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSESIdentity(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { IdentityType := fields["identityType"] client := ses.NewFromConfig(cfg) @@ -266,10 +267,10 @@ func GetSESIdentity(ctx context.Context, cfg aws.Config, fields map[string]strin return nil, err } - var values []Resource + var values []models.Resource for _, v := range out.Identities { resource, err := sESIdentityHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -282,12 +283,12 @@ func GetSESIdentity(ctx context.Context, cfg aws.Config, fields map[string]strin return values, nil } -func SESContactList(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SESContactList(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sesv2.NewFromConfig(cfg) paginator := sesv2.NewListContactListsPaginator(client, &sesv2.ListContactListsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -295,7 +296,7 @@ func SESContactList(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } for _, v := range page.ContactLists { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ContactListName, Name: *v.ContactListName, @@ -314,7 +315,7 @@ func SESContactList(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func SESReceiptFilter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SESReceiptFilter(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ses.NewFromConfig(cfg) @@ -323,9 +324,9 @@ func SESReceiptFilter(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - var values []Resource + var values []models.Resource for _, v := range output.Filters { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Name, Name: *v.Name, @@ -343,11 +344,11 @@ func SESReceiptFilter(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func SESReceiptRuleSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SESReceiptRuleSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ses.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListReceiptRuleSets(ctx, &ses.ListReceiptRuleSetsInput{NextToken: prevToken}) if err != nil { @@ -360,7 +361,7 @@ func SESReceiptRuleSet(ctx context.Context, cfg aws.Config, stream *StreamSender return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *output.Metadata.Name, Name: *output.Metadata.Name, @@ -385,11 +386,11 @@ func SESReceiptRuleSet(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func SESTemplate(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SESTemplate(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ses.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListTemplates(ctx, &ses.ListTemplatesInput{NextToken: prevToken}) if err != nil { @@ -397,7 +398,7 @@ func SESTemplate(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R } for _, v := range output.TemplatesMetadata { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Name, Name: *v.Name, diff --git a/provider/describer/shield.go b/provider/describer/shield.go index 5090fec2..a49d50a8 100755 --- a/provider/describer/shield.go +++ b/provider/describer/shield.go @@ -3,6 +3,7 @@ package describer import ( "context" _ "database/sql/driver" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/service/shield/types" "github.com/opengovern/og-describer-aws/provider/model" @@ -11,11 +12,11 @@ import ( "github.com/aws/aws-sdk-go-v2/service/shield" ) -func ShieldProtectionGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func ShieldProtectionGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := shield.NewFromConfig(cfg) paginator := shield.NewListProtectionGroupsPaginator(client, &shield.ListProtectionGroupsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -30,7 +31,7 @@ func ShieldProtectionGroup(ctx context.Context, cfg aws.Config, stream *StreamSe if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -47,7 +48,7 @@ func ShieldProtectionGroup(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func shieldProtectionGroupHandle(ctx context.Context, cfg aws.Config, v types.ProtectionGroup) (Resource, error) { +func shieldProtectionGroupHandle(ctx context.Context, cfg aws.Config, v types.ProtectionGroup) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := shield.NewFromConfig(cfg) @@ -56,12 +57,12 @@ func shieldProtectionGroupHandle(ctx context.Context, cfg aws.Config, v types.Pr }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "InvalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ProtectionGroupArn, Name: *v.ProtectionGroupId, @@ -72,10 +73,10 @@ func shieldProtectionGroupHandle(ctx context.Context, cfg aws.Config, v types.Pr } return resource, nil } -func GetShieldProtectionGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetShieldProtectionGroup(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { protectionGroupId := fields["id"] client := shield.NewFromConfig(cfg) - var values []Resource + var values []models.Resource out, err := client.DescribeProtectionGroup(ctx, &shield.DescribeProtectionGroupInput{ ProtectionGroupId: &protectionGroupId, @@ -91,7 +92,7 @@ func GetShieldProtectionGroup(ctx context.Context, cfg aws.Config, fields map[st if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/simspaceweaver.go b/provider/describer/simspaceweaver.go index 490d0828..60c53b0e 100755 --- a/provider/describer/simspaceweaver.go +++ b/provider/describer/simspaceweaver.go @@ -4,18 +4,19 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/simspaceweaver" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/opengovern/og-describer-aws/provider/model" ) -func SimSpaceWeaverSimulation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SimSpaceWeaverSimulation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := simspaceweaver.NewFromConfig(cfg) paginator := simspaceweaver.NewListSimulationsPaginator(client, &simspaceweaver.ListSimulationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -45,7 +46,7 @@ func SimSpaceWeaverSimulation(ctx context.Context, cfg aws.Config, stream *Strea return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: name, diff --git a/provider/describer/sns.go b/provider/describer/sns.go index fc9a70cc..1f1761d2 100755 --- a/provider/describer/sns.go +++ b/provider/describer/sns.go @@ -4,18 +4,19 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/sns/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sns" "github.com/opengovern/og-describer-aws/provider/model" ) -func SNSSubscription(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SNSSubscription(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sns.NewFromConfig(cfg) paginator := sns.NewListSubscriptionsPaginator(client, &sns.ListSubscriptionsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -37,7 +38,7 @@ func SNSSubscription(ctx context.Context, cfg aws.Config, stream *StreamSender) output = &sns.GetSubscriptionAttributesOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.SubscriptionArn, Name: nameFromArn(*v.SubscriptionArn), @@ -59,11 +60,11 @@ func SNSSubscription(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func SNSTopic(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SNSTopic(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := sns.NewFromConfig(cfg) paginator := sns.NewListTopicsPaginator(client, &sns.ListTopicsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -72,7 +73,7 @@ func SNSTopic(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso for _, v := range page.Topics { resource, err := sNSTopicHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -92,7 +93,7 @@ func SNSTopic(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func sNSTopicHandle(ctx context.Context, cfg aws.Config, v types.Topic) (Resource, error) { +func sNSTopicHandle(ctx context.Context, cfg aws.Config, v types.Topic) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sns.NewFromConfig(cfg) @@ -101,9 +102,9 @@ func sNSTopicHandle(ctx context.Context, cfg aws.Config, v types.Topic) (Resourc }) if err != nil { if isErr(err, "GetTopicAttributesNotFound") || isErr(err, "invalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } tOutput, err := client.ListTagsForResource(ctx, &sns.ListTagsForResourceInput{ @@ -111,12 +112,12 @@ func sNSTopicHandle(ctx context.Context, cfg aws.Config, v types.Topic) (Resourc }) if err != nil { if isErr(err, "ListTagsForResourceNotFound") || isErr(err, "invalidParameterValue") { - return Resource{}, nil + return models.Resource{}, nil } - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TopicArn, Name: nameFromArn(*v.TopicArn), @@ -127,9 +128,9 @@ func sNSTopicHandle(ctx context.Context, cfg aws.Config, v types.Topic) (Resourc } return resource, nil } -func GetSNSTopic(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSNSTopic(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { arn := fields["arn"] - var values []Resource + var values []models.Resource client := sns.NewFromConfig(cfg) list, err := client.ListTopics(ctx, &sns.ListTopicsInput{}) if err != nil { @@ -141,7 +142,7 @@ func GetSNSTopic(ctx context.Context, cfg aws.Config, fields map[string]string) continue } resource, err := sNSTopicHandle(ctx, cfg, v) - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } diff --git a/provider/describer/sqs.go b/provider/describer/sqs.go index b3ce5693..25cb0a71 100755 --- a/provider/describer/sqs.go +++ b/provider/describer/sqs.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sqs" @@ -9,12 +10,12 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func SQSQueue(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SQSQueue(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sqs.NewFromConfig(cfg) paginator := sqs.NewListQueuesPaginator(client, &sqs.ListQueuesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -56,7 +57,7 @@ func SQSQueue(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso // Add Queue URL since it doesn't exists in the description output.Attributes["QueueUrl"] = url - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: url, Name: nameFromArn(url), @@ -77,9 +78,9 @@ func SQSQueue(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Reso return values, nil } -func sQSQueueHandle(ctx context.Context, url string, queueAttributes *sqs.GetQueueAttributesOutput, tagOutput *sqs.ListQueueTagsOutput) Resource { +func sQSQueueHandle(ctx context.Context, url string, queueAttributes *sqs.GetQueueAttributesOutput, tagOutput *sqs.ListQueueTagsOutput) models.Resource { describeCtx := GetDescribeContext(ctx) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: url, Name: nameFromArn(url), @@ -90,9 +91,9 @@ func sQSQueueHandle(ctx context.Context, url string, queueAttributes *sqs.GetQue } return resource } -func GetSQSQueue(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetSQSQueue(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { QueueName := fields["name"] - var values []Resource + var values []models.Resource client := sqs.NewFromConfig(cfg) url, err := client.GetQueueUrl(ctx, &sqs.GetQueueUrlInput{ QueueName: &QueueName, diff --git a/provider/describer/ssm.go b/provider/describer/ssm.go index ad81fcca..79679061 100755 --- a/provider/describer/ssm.go +++ b/provider/describer/ssm.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/aws/smithy-go" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ssm" @@ -14,12 +15,12 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func SSMManagedInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMManagedInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewDescribeInstanceInformationPaginator(client, &ssm.DescribeInstanceInformationInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -34,7 +35,7 @@ func SSMManagedInstance(ctx context.Context, cfg aws.Config, stream *StreamSende } else { name = *item.InstanceId } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: name, @@ -54,12 +55,12 @@ func SSMManagedInstance(ctx context.Context, cfg aws.Config, stream *StreamSende return values, nil } -func SSMInventory(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMInventory(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewGetInventoryPaginator(client, &ssm.GetInventoryInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -78,7 +79,7 @@ func SSMInventory(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] } schemas = append(schemas, schemaPage.Schemas...) } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *inventory.Id, Name: *inventory.Id, @@ -105,11 +106,11 @@ func SSMInventory(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func SSMInventoryEntry(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMInventoryEntry(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewGetInventoryPaginator(client, &ssm.GetInventoryInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -126,7 +127,7 @@ func SSMInventoryEntry(ctx context.Context, cfg aws.Config, stream *StreamSender return nil, err } for _, v := range op.Entries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *op.InstanceId, Name: *op.InstanceId, @@ -153,12 +154,12 @@ func SSMInventoryEntry(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func SSMManagedInstanceCompliance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMManagedInstanceCompliance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewDescribeInstanceInformationPaginator(client, &ssm.DescribeInstanceInformationInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -178,7 +179,7 @@ func SSMManagedInstanceCompliance(ctx context.Context, cfg aws.Config, stream *S for _, item := range cpage.ComplianceItems { arn := "arn:" + describeCtx.Partition + ":ssm:" + describeCtx.Region + ":" + describeCtx.AccountID + ":managed-instance/" + *item.ResourceId + "/compliance-item/" + *item.Id + ":" + *item.ComplianceType - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *item.Title, @@ -201,12 +202,12 @@ func SSMManagedInstanceCompliance(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func SSMAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewListAssociationsPaginator(client, &ssm.ListAssociationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -222,7 +223,7 @@ func SSMAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ( } arn := fmt.Sprintf("arn:%s:ssm:%s:%s:association/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.AssociationId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.AssociationId, Name: *v.Name, @@ -245,7 +246,7 @@ func SSMAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func SSMDocument(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMDocument(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewListDocumentsPaginator(client, &ssm.ListDocumentsInput{ @@ -257,7 +258,7 @@ func SSMDocument(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R }, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -287,7 +288,7 @@ func SSMDocument(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R arn += "/" + *v.Name } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Name, Name: *v.Name, @@ -311,7 +312,7 @@ func SSMDocument(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func SSMDocumentPermission(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMDocumentPermission(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewListDocumentsPaginator(client, &ssm.ListDocumentsInput{ @@ -323,7 +324,7 @@ func SSMDocumentPermission(ctx context.Context, cfg aws.Config, stream *StreamSe }, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -345,7 +346,7 @@ func SSMDocumentPermission(ctx context.Context, cfg aws.Config, stream *StreamSe return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Name, Name: *v.Name, @@ -366,12 +367,12 @@ func SSMDocumentPermission(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func SSMMaintenanceWindow(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMMaintenanceWindow(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewDescribeMaintenanceWindowsPaginator(client, &ssm.DescribeMaintenanceWindowsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -409,7 +410,7 @@ func SSMMaintenanceWindow(ctx context.Context, cfg aws.Config, stream *StreamSen } aka := "arn:" + describeCtx.Partition + ":ssm:" + describeCtx.Region + ":" + describeCtx.AccountID + ":maintenancewindow" + "/" + *v.WindowId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: aka, Name: *v.Name, @@ -435,7 +436,7 @@ func SSMMaintenanceWindow(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func SSMMaintenanceWindowTarget(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMMaintenanceWindowTarget(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) windows, err := SSMMaintenanceWindow(ctx, cfg, nil) if err != nil { @@ -444,7 +445,7 @@ func SSMMaintenanceWindowTarget(ctx context.Context, cfg aws.Config, stream *Str client := ssm.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, w := range windows { window := w.Description.(types.MaintenanceWindowIdentity) paginator := ssm.NewDescribeMaintenanceWindowTargetsPaginator(client, &ssm.DescribeMaintenanceWindowTargetsInput{ @@ -458,7 +459,7 @@ func SSMMaintenanceWindowTarget(ctx context.Context, cfg aws.Config, stream *Str } for _, v := range page.Targets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.WindowTargetId, Name: *v.Name, @@ -478,7 +479,7 @@ func SSMMaintenanceWindowTarget(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func SSMMaintenanceWindowTask(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMMaintenanceWindowTask(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) windows, err := SSMMaintenanceWindow(ctx, cfg, nil) if err != nil { @@ -487,7 +488,7 @@ func SSMMaintenanceWindowTask(ctx context.Context, cfg aws.Config, stream *Strea client := ssm.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, w := range windows { window := w.Description.(types.MaintenanceWindowIdentity) paginator := ssm.NewDescribeMaintenanceWindowTasksPaginator(client, &ssm.DescribeMaintenanceWindowTasksInput{ @@ -501,7 +502,7 @@ func SSMMaintenanceWindowTask(ctx context.Context, cfg aws.Config, stream *Strea } for _, v := range page.Tasks { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.TaskArn, Name: *v.Name, @@ -521,12 +522,12 @@ func SSMMaintenanceWindowTask(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func SSMParameter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMParameter(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewDescribeParametersPaginator(client, &ssm.DescribeParametersInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -561,7 +562,7 @@ func SSMParameter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Name, Name: *v.Name, @@ -584,7 +585,7 @@ func SSMParameter(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return values, nil } -func SSMPatchBaseline(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMPatchBaseline(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewDescribePatchBaselinesPaginator(client, &ssm.DescribePatchBaselinesInput{ @@ -596,7 +597,7 @@ func SSMPatchBaseline(ctx context.Context, cfg aws.Config, stream *StreamSender) }, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -626,7 +627,7 @@ func SSMPatchBaseline(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: aka, Name: *v.BaselineName, @@ -650,12 +651,12 @@ func SSMPatchBaseline(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func SSMResourceDataSync(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMResourceDataSync(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewListResourceDataSyncPaginator(client, &ssm.ListResourceDataSyncInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -663,7 +664,7 @@ func SSMResourceDataSync(ctx context.Context, cfg aws.Config, stream *StreamSend } for _, v := range page.ResourceDataSyncItems { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.SyncName, Name: *v.SyncName, @@ -681,11 +682,11 @@ func SSMResourceDataSync(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func SSMManagedInstancePatchState(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSMManagedInstancePatchState(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssm.NewFromConfig(cfg) paginator := ssm.NewDescribeInstanceInformationPaginator(client, &ssm.DescribeInstanceInformationInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -703,7 +704,7 @@ func SSMManagedInstancePatchState(ctx context.Context, cfg aws.Config, stream *S } for _, item := range pagePS.InstancePatchStates { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *item.InstanceId, Description: model.SSMManagedInstancePatchStateDescription{ diff --git a/provider/describer/ssoadmin.go b/provider/describer/ssoadmin.go index 2c1d0a33..6826f1d5 100755 --- a/provider/describer/ssoadmin.go +++ b/provider/describer/ssoadmin.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -12,19 +13,19 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func SSOAdminInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSOAdminInstance(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := ssoadmin.NewFromConfig(cfg) paginator := ssoadmin.NewListInstancesPaginator(client, &ssoadmin.ListInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } for _, v := range page.Instances { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.InstanceArn, Name: *v.InstanceArn, @@ -44,11 +45,11 @@ func SSOAdminInstance(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func SSOAdminAccountAssignment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSOAdminAccountAssignment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ssoadmin.NewFromConfig(cfg) paginator := ssoadmin.NewListInstancesPaginator(client, &ssoadmin.ListInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -73,12 +74,12 @@ func SSOAdminAccountAssignment(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func ListSSOAdminInstanceAccountAssignments(ctx context.Context, client *ssoadmin.Client, instance types.InstanceMetadata) ([]Resource, error) { +func ListSSOAdminInstanceAccountAssignments(ctx context.Context, client *ssoadmin.Client, instance types.InstanceMetadata) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) paginator := ssoadmin.NewListPermissionSetsPaginator(client, &ssoadmin.ListPermissionSetsInput{ InstanceArn: instance.InstanceArn, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -95,7 +96,7 @@ func ListSSOAdminInstanceAccountAssignments(ctx context.Context, client *ssoadmi } for _, accountA := range accountAssignment.AccountAssignments { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: fmt.Sprintf("%s|%s|%s", *accountA.AccountId, *accountA.PermissionSetArn, *accountA.PrincipalId), Description: model.SSOAdminAccountAssignmentDescription{ @@ -110,11 +111,11 @@ func ListSSOAdminInstanceAccountAssignments(ctx context.Context, client *ssoadmi return values, nil } -func SSOAdminPermissionSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSOAdminPermissionSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ssoadmin.NewFromConfig(cfg) paginator := ssoadmin.NewListInstancesPaginator(client, &ssoadmin.ListInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -139,11 +140,11 @@ func SSOAdminPermissionSet(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func ListSSOAdminInstancePermissionSets(ctx context.Context, client *ssoadmin.Client, instanceArn string) ([]Resource, error) { +func ListSSOAdminInstancePermissionSets(ctx context.Context, client *ssoadmin.Client, instanceArn string) ([]models.Resource, error) { paginator := ssoadmin.NewListPermissionSetsPaginator(client, &ssoadmin.ListPermissionSetsInput{ InstanceArn: &instanceArn, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -160,7 +161,7 @@ func ListSSOAdminInstancePermissionSets(ctx context.Context, client *ssoadmin.Cl return values, nil } -func GetSSOAdminPermissionSet(ctx context.Context, client *ssoadmin.Client, instanceArn, permissionSetArn string) (*Resource, error) { +func GetSSOAdminPermissionSet(ctx context.Context, client *ssoadmin.Client, instanceArn, permissionSetArn string) (*models.Resource, error) { describeCtx := GetDescribeContext(ctx) detail, err := client.DescribePermissionSet(ctx, &ssoadmin.DescribePermissionSetInput{ InstanceArn: aws.String(instanceArn), @@ -190,7 +191,7 @@ func GetSSOAdminPermissionSet(ctx context.Context, client *ssoadmin.Client, inst for _, tag := range tags { tagsMap[*tag.Key] = *tag.Value } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *detail.PermissionSet.PermissionSetArn, ARN: *detail.PermissionSet.PermissionSetArn, @@ -203,11 +204,11 @@ func GetSSOAdminPermissionSet(ctx context.Context, client *ssoadmin.Client, inst return &resource, nil } -func SSOAdminManagedPolicyAttachment(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SSOAdminManagedPolicyAttachment(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := ssoadmin.NewFromConfig(cfg) paginator := ssoadmin.NewListInstancesPaginator(client, &ssoadmin.ListInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -232,11 +233,11 @@ func SSOAdminManagedPolicyAttachment(ctx context.Context, cfg aws.Config, stream return values, nil } -func ListSSOAdminInstanceManagedPolicyAttachments(ctx context.Context, client *ssoadmin.Client, instanceArn string) ([]Resource, error) { +func ListSSOAdminInstanceManagedPolicyAttachments(ctx context.Context, client *ssoadmin.Client, instanceArn string) ([]models.Resource, error) { paginator := ssoadmin.NewListPermissionSetsPaginator(client, &ssoadmin.ListPermissionSetsInput{ InstanceArn: &instanceArn, }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -253,14 +254,14 @@ func ListSSOAdminInstanceManagedPolicyAttachments(ctx context.Context, client *s return values, nil } -func ListSSOAdminPermissionSetPolicyAttachments(ctx context.Context, client *ssoadmin.Client, instanceArn, permissionSetArn string) ([]Resource, error) { +func ListSSOAdminPermissionSetPolicyAttachments(ctx context.Context, client *ssoadmin.Client, instanceArn, permissionSetArn string) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) paginator := ssoadmin.NewListManagedPoliciesInPermissionSetPaginator(client, &ssoadmin.ListManagedPoliciesInPermissionSetInput{ InstanceArn: aws.String(instanceArn), PermissionSetArn: aws.String(permissionSetArn), }) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { output, err := paginator.NextPage(ctx) if err != nil { @@ -268,7 +269,7 @@ func ListSSOAdminPermissionSetPolicyAttachments(ctx context.Context, client *sso } for _, item := range output.AttachedManagedPolicies { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *item.Arn, ARN: *item.Arn, @@ -284,14 +285,14 @@ func ListSSOAdminPermissionSetPolicyAttachments(ctx context.Context, client *sso return values, nil } -func UserEffectiveAccess(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func UserEffectiveAccess(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := identitystore.NewFromConfig(cfg) ssoadminClient := ssoadmin.NewFromConfig(cfg) paginator := ssoadmin.NewListInstancesPaginator(ssoadminClient, &ssoadmin.ListInstancesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -336,7 +337,7 @@ func UserEffectiveAccess(ctx context.Context, cfg aws.Config, stream *StreamSend if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: id, Description: model.UserEffectiveAccessDescription{ @@ -364,7 +365,7 @@ func UserEffectiveAccess(ctx context.Context, cfg aws.Config, stream *StreamSend if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: id, Description: model.UserEffectiveAccessDescription{ diff --git a/provider/describer/stepfunction.go b/provider/describer/stepfunction.go index 602a99f9..775493f9 100755 --- a/provider/describer/stepfunction.go +++ b/provider/describer/stepfunction.go @@ -6,18 +6,19 @@ import ( "github.com/aws/aws-sdk-go-v2/service/sfn" "github.com/aws/aws-sdk-go-v2/service/sfn/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/opengovern/og-describer-aws/provider/model" ) -func StepFunctionsStateMachine(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func StepFunctionsStateMachine(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sfn.NewFromConfig(cfg) paginator := sfn.NewListStateMachinesPaginator(client, &sfn.ListStateMachinesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -49,7 +50,7 @@ func StepFunctionsStateMachine(ctx context.Context, cfg aws.Config, stream *Stre data.Definition = aws.String(v[:5000]) } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.StateMachineArn, Name: name, @@ -77,13 +78,13 @@ type historyInfo struct { ExecutionArn string } -func StepFunctionsStateMachineExecutionHistories(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func StepFunctionsStateMachineExecutionHistories(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sfn.NewFromConfig(cfg) paginator := sfn.NewListStateMachinesPaginator(client, &sfn.ListStateMachinesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -146,7 +147,7 @@ func StepFunctionsStateMachineExecutionHistories(ctx context.Context, cfg aws.Co for item := range executionCh { for _, data := range item { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: data.ExecutionArn, Name: data.ExecutionArn, @@ -170,13 +171,13 @@ func StepFunctionsStateMachineExecutionHistories(ctx context.Context, cfg aws.Co return values, nil } -func StepFunctionsStateMachineExecution(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func StepFunctionsStateMachineExecution(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sfn.NewFromConfig(cfg) paginator := sfn.NewListStateMachinesPaginator(client, &sfn.ListStateMachinesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -215,7 +216,7 @@ func StepFunctionsStateMachineExecution(ctx context.Context, cfg aws.Config, str data.Output = aws.String(v[:5000]) } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *execution.ExecutionArn, Name: *execution.ExecutionArn, diff --git a/provider/describer/storagegateway.go b/provider/describer/storagegateway.go index 3decc663..0a5a0c73 100755 --- a/provider/describer/storagegateway.go +++ b/provider/describer/storagegateway.go @@ -4,17 +4,18 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/storagegateway/types" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/storagegateway" "github.com/opengovern/og-describer-aws/provider/model" ) -func StorageGatewayStorageGateway(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func StorageGatewayStorageGateway(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := storagegateway.NewFromConfig(cfg) paginator := storagegateway.NewListGatewaysPaginator(client, &storagegateway.ListGatewaysInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -39,17 +40,17 @@ func StorageGatewayStorageGateway(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func storageGatewayStorageGatewayHandle(ctx context.Context, cfg aws.Config, gatewayARN string, gatewayId string, v types.GatewayInfo) (Resource, error) { +func storageGatewayStorageGatewayHandle(ctx context.Context, cfg aws.Config, gatewayARN string, gatewayId string, v types.GatewayInfo) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := storagegateway.NewFromConfig(cfg) tags, err := client.ListTagsForResource(ctx, &storagegateway.ListTagsForResourceInput{ ResourceARN: &gatewayARN, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: gatewayARN, Name: gatewayId, @@ -60,7 +61,7 @@ func storageGatewayStorageGatewayHandle(ctx context.Context, cfg aws.Config, gat } return resource, nil } -func GetStorageGatewayStorageGateway(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetStorageGatewayStorageGateway(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { gatewayArn := fields["arn"] client := storagegateway.NewFromConfig(cfg) out, err := client.DescribeGatewayInformation(ctx, &storagegateway.DescribeGatewayInformationInput{ @@ -82,7 +83,7 @@ func GetStorageGatewayStorageGateway(ctx context.Context, cfg aws.Config, fields HostEnvironmentId: out.HostEnvironmentId, } - var values []Resource + var values []models.Resource resource, err := storageGatewayStorageGatewayHandle(ctx, cfg, *out.GatewayARN, *out.GatewayId, storageGateway) if err != nil { return nil, err diff --git a/provider/describer/sts.go b/provider/describer/sts.go index dc660d20..4257fbc1 100755 --- a/provider/describer/sts.go +++ b/provider/describer/sts.go @@ -3,6 +3,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/opengovern/og-describer-aws/provider/model" "github.com/aws/aws-sdk-go-v2/aws" @@ -20,16 +21,16 @@ func STSAccount(ctx context.Context, cfg aws.Config) (string, error) { return *acc.Account, nil } -func STSCallerIdentity(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func STSCallerIdentity(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := sts.NewFromConfig(cfg) - var values []Resource + var values []models.Resource ci, err := client.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *ci.UserId, ARN: *ci.Arn, diff --git a/provider/describer/synthetics.go b/provider/describer/synthetics.go index bdfd6909..49446c97 100755 --- a/provider/describer/synthetics.go +++ b/provider/describer/synthetics.go @@ -2,17 +2,18 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/synthetics" ) -func SyntheticsCanary(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func SyntheticsCanary(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := synthetics.NewFromConfig(cfg) paginator := synthetics.NewDescribeCanariesPaginator(client, &synthetics.DescribeCanariesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -20,7 +21,7 @@ func SyntheticsCanary(ctx context.Context, cfg aws.Config, stream *StreamSender) } for _, v := range page.Canaries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.Id, Name: *v.Name, diff --git a/provider/describer/tagging.go b/provider/describer/tagging.go index 9da942fd..b257049b 100755 --- a/provider/describer/tagging.go +++ b/provider/describer/tagging.go @@ -4,24 +4,25 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/opengovern/og-describer-aws/provider/model" ) -func TaggingResources(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func TaggingResources(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := resourcegroupstaggingapi.NewFromConfig(cfg) paginator := resourcegroupstaggingapi.NewGetResourcesPaginator(client, &resourcegroupstaggingapi.GetResourcesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { return nil, err } for _, v := range page.ResourceTagMappingList { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ResourceARN, Name: *v.ResourceARN, diff --git a/provider/describer/timestream.go b/provider/describer/timestream.go index 9458a813..3d6a8bcf 100644 --- a/provider/describer/timestream.go +++ b/provider/describer/timestream.go @@ -2,18 +2,19 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/timestreamwrite" "github.com/opengovern/og-describer-aws/provider/model" ) -func TimestreamDatabase(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func TimestreamDatabase(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := timestreamwrite.NewFromConfig(cfg) paginator := timestreamwrite.NewListDatabasesPaginator(client, ×treamwrite.ListDatabasesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -26,7 +27,7 @@ func TimestreamDatabase(ctx context.Context, cfg aws.Config, stream *StreamSende return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.Arn, Name: *v.DatabaseName, diff --git a/provider/describer/waf.go b/provider/describer/waf.go index 30a564e9..5121500c 100755 --- a/provider/describer/waf.go +++ b/provider/describer/waf.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/smithy-go" @@ -23,7 +24,7 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func WAFv2IPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFv2IPSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafv2.NewFromConfig(cfg) @@ -34,7 +35,7 @@ func WAFv2IPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re scopes = append(scopes, types.ScopeCloudfront) } - var values []Resource + var values []models.Resource for _, scope := range scopes { err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListIPSets(ctx, &wafv2.ListIPSetsInput{ @@ -65,7 +66,7 @@ func WAFv2IPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ARN, Name: *v.Name, @@ -95,7 +96,7 @@ func WAFv2IPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Re return values, nil } -func WAFv2LoggingConfiguration(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFv2LoggingConfiguration(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafv2.NewFromConfig(cfg) @@ -106,7 +107,7 @@ func WAFv2LoggingConfiguration(ctx context.Context, cfg aws.Config, stream *Stre scopes = append(scopes, types.ScopeCloudfront) } - var values []Resource + var values []models.Resource for _, scope := range scopes { err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListLoggingConfigurations(ctx, &wafv2.ListLoggingConfigurationsInput{ @@ -118,7 +119,7 @@ func WAFv2LoggingConfiguration(ctx context.Context, cfg aws.Config, stream *Stre } for _, v := range output.LoggingConfigurations { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ResourceArn, // TODO: might not be the actual ARN Name: *v.ResourceArn, @@ -143,7 +144,7 @@ func WAFv2LoggingConfiguration(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func WAFv2RegexPatternSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFv2RegexPatternSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafv2.NewFromConfig(cfg) @@ -154,7 +155,7 @@ func WAFv2RegexPatternSet(ctx context.Context, cfg aws.Config, stream *StreamSen scopes = append(scopes, types.ScopeCloudfront) } - var values []Resource + var values []models.Resource for _, scope := range scopes { err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListRegexPatternSets(ctx, &wafv2.ListRegexPatternSetsInput{ @@ -200,7 +201,7 @@ func WAFv2RegexPatternSet(ctx context.Context, cfg aws.Config, stream *StreamSen } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ARN, Name: *v.Name, @@ -230,7 +231,7 @@ func WAFv2RegexPatternSet(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func WAFv2RuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFv2RuleGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafv2.NewFromConfig(cfg) @@ -241,7 +242,7 @@ func WAFv2RuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ( scopes = append(scopes, types.ScopeCloudfront) } - var values []Resource + var values []models.Resource for _, scope := range scopes { err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListRuleGroups(ctx, &wafv2.ListRuleGroupsInput{ @@ -270,7 +271,7 @@ func WAFv2RuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ( ruleGroupTags, err := client.ListTagsForResource(ctx, param) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ARN, Name: *v.Name, @@ -299,7 +300,7 @@ func WAFv2RuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ( return values, nil } -func WAFv2WebACL(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFv2WebACL(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { scopes := []types.Scope{ types.ScopeRegional, } @@ -307,7 +308,7 @@ func WAFv2WebACL(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R scopes = append(scopes, types.ScopeCloudfront) } - var values []Resource + var values []models.Resource for _, scope := range scopes { acls, err := listWAFv2WebACLs(ctx, cfg, scope) if err != nil { @@ -333,7 +334,7 @@ func WAFv2WebACL(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]R return values, nil } -func wAFv2WebACLHandle(ctx context.Context, cfg aws.Config, v types.WebACLSummary, scope types.Scope) (Resource, error) { +func wAFv2WebACLHandle(ctx context.Context, cfg aws.Config, v types.WebACLSummary, scope types.Scope) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafv2.NewFromConfig(cfg) @@ -343,7 +344,7 @@ func wAFv2WebACLHandle(ctx context.Context, cfg aws.Config, v types.WebACLSummar Scope: scope, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } logC, err := client.GetLoggingConfiguration(ctx, &wafv2.GetLoggingConfigurationInput{ @@ -362,7 +363,7 @@ func wAFv2WebACLHandle(ctx context.Context, cfg aws.Config, v types.WebACLSummar } if err != nil { - return Resource{}, err + return models.Resource{}, err } } @@ -370,7 +371,7 @@ func wAFv2WebACLHandle(ctx context.Context, cfg aws.Config, v types.WebACLSummar ResourceARN: out.WebACL.ARN, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } var associatedResources []string @@ -382,7 +383,7 @@ func wAFv2WebACLHandle(ctx context.Context, cfg aws.Config, v types.WebACLSummar WebACLId: v.Id, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } if output.DistributionList != nil { @@ -407,17 +408,17 @@ func wAFv2WebACLHandle(ctx context.Context, cfg aws.Config, v types.WebACLSummar if ae.ErrorCode() == "WAFNonexistentItemException" { op = &wafv2.ListResourcesForWebACLOutput{} } else { - return Resource{}, err + return models.Resource{}, err } } else { - return Resource{}, err + return models.Resource{}, err } } associatedResources = append(associatedResources, op.ResourceArns...) } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.ARN, Name: *v.Name, @@ -433,7 +434,7 @@ func wAFv2WebACLHandle(ctx context.Context, cfg aws.Config, v types.WebACLSummar return resource, nil } -func GetWAFv2WebACL(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetWAFv2WebACL(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { scopeInput := fields["scope"] scopes := []types.Scope{ types.ScopeRegional, @@ -442,7 +443,7 @@ func GetWAFv2WebACL(ctx context.Context, cfg aws.Config, fields map[string]strin scopes = append(scopes, types.ScopeCloudfront) } - var values []Resource + var values []models.Resource for _, scope := range scopes { if string(scope) != scopeInput { continue @@ -487,9 +488,9 @@ func listWAFv2WebACLs(ctx context.Context, cfg aws.Config, scope types.Scope) ([ } // Returns ResourceArns that have a WebAcl Associated -func WAFv2WebACLAssociation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFv2WebACLAssociation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) - var values []Resource + var values []models.Resource regionalACls, err := listWAFv2WebACLs(ctx, cfg, types.ScopeRegional) if err != nil { @@ -505,7 +506,7 @@ func WAFv2WebACLAssociation(ctx context.Context, cfg aws.Config, stream *StreamS return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *acl.Id, // Unique per WebACL Name: *acl.Name, @@ -541,7 +542,7 @@ func WAFv2WebACLAssociation(ctx context.Context, cfg aws.Config, stream *StreamS return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *acl.Id, // Unique per WebACL Name: *acl.Name, @@ -569,11 +570,11 @@ func WAFv2WebACLAssociation(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func WAFRegionalByteMatchSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalByteMatchSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListByteMatchSets(ctx, &wafregional.ListByteMatchSetsInput{ NextMarker: prevToken, @@ -583,7 +584,7 @@ func WAFRegionalByteMatchSet(ctx context.Context, cfg aws.Config, stream *Stream } for _, v := range output.ByteMatchSets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.ByteMatchSetId, Name: *v.Name, @@ -607,11 +608,11 @@ func WAFRegionalByteMatchSet(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func WAFRegionalGeoMatchSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalGeoMatchSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListGeoMatchSets(ctx, &wafregional.ListGeoMatchSetsInput{ NextMarker: prevToken, @@ -621,7 +622,7 @@ func WAFRegionalGeoMatchSet(ctx context.Context, cfg aws.Config, stream *StreamS } for _, v := range output.GeoMatchSets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.GeoMatchSetId, Name: *v.Name, @@ -645,11 +646,11 @@ func WAFRegionalGeoMatchSet(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func WAFRegionalIPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalIPSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListIPSets(ctx, &wafregional.ListIPSetsInput{ NextMarker: prevToken, @@ -659,7 +660,7 @@ func WAFRegionalIPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) } for _, v := range output.IPSets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.IPSetId, Name: *v.Name, @@ -683,11 +684,11 @@ func WAFRegionalIPSet(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func WAFRateBasedRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRateBasedRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := waf.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListRateBasedRules(ctx, &waf.ListRateBasedRulesInput{ NextMarker: prevToken, @@ -713,7 +714,7 @@ func WAFRateBasedRule(ctx context.Context, cfg aws.Config, stream *StreamSender) return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.Name, @@ -742,11 +743,11 @@ func WAFRateBasedRule(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func WAFRegionalRegexPatternSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalRegexPatternSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListRegexPatternSets(ctx, &wafregional.ListRegexPatternSetsInput{ NextMarker: prevToken, @@ -756,7 +757,7 @@ func WAFRegionalRegexPatternSet(ctx context.Context, cfg aws.Config, stream *Str } for _, v := range output.RegexPatternSets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.RegexPatternSetId, Name: *v.Name, @@ -780,10 +781,10 @@ func WAFRegionalRegexPatternSet(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func WAFRegionalRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListRules(ctx, &wafregional.ListRulesInput{ NextMarker: prevToken, @@ -815,7 +816,7 @@ func WAFRegionalRule(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func wAFRegionalRuleHandle(ctx context.Context, cfg aws.Config, v regionaltypes.RuleSummary) (Resource, error) { +func wAFRegionalRuleHandle(ctx context.Context, cfg aws.Config, v regionaltypes.RuleSummary) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) arn := fmt.Sprintf("arn:%s:waf-regional:%s:%s:rule/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.RuleId) @@ -823,15 +824,15 @@ func wAFRegionalRuleHandle(ctx context.Context, cfg aws.Config, v regionaltypes. ResourceARN: &arn, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } rule, err := client.GetRule(ctx, &wafregional.GetRuleInput{ RuleId: v.RuleId, }) if err != nil { - return Resource{}, err + return models.Resource{}, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, ID: *v.RuleId, @@ -844,10 +845,10 @@ func wAFRegionalRuleHandle(ctx context.Context, cfg aws.Config, v regionaltypes. return resource, nil } -func GetWAFRegionalRule(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetWAFRegionalRule(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { roleId := fields["id"] client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource role, err := client.ListRules(ctx, &wafregional.ListRulesInput{}) if err != nil { return nil, err @@ -865,12 +866,12 @@ func GetWAFRegionalRule(ctx context.Context, cfg aws.Config, fields map[string]s return values, nil } -func WAFRegionalRuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalRuleGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListRuleGroups(ctx, &wafregional.ListRuleGroupsInput{ NextMarker: prevToken, @@ -903,7 +904,7 @@ func WAFRegionalRuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSen return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *rule.RuleGroup.Name, @@ -933,11 +934,11 @@ func WAFRegionalRuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSen return values, nil } -func WAFRegionalSizeConstraintSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalSizeConstraintSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListSizeConstraintSets(ctx, &wafregional.ListSizeConstraintSetsInput{ NextMarker: prevToken, @@ -947,7 +948,7 @@ func WAFRegionalSizeConstraintSet(ctx context.Context, cfg aws.Config, stream *S } for _, v := range output.SizeConstraintSets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.SizeConstraintSetId, Name: *v.Name, @@ -971,11 +972,11 @@ func WAFRegionalSizeConstraintSet(ctx context.Context, cfg aws.Config, stream *S return values, nil } -func WAFRegionalSqlInjectionMatchSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalSqlInjectionMatchSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListSqlInjectionMatchSets(ctx, &wafregional.ListSqlInjectionMatchSetsInput{ NextMarker: prevToken, @@ -985,7 +986,7 @@ func WAFRegionalSqlInjectionMatchSet(ctx context.Context, cfg aws.Config, stream } for _, v := range output.SqlInjectionMatchSets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.SqlInjectionMatchSetId, Name: *v.Name, @@ -1009,11 +1010,11 @@ func WAFRegionalSqlInjectionMatchSet(ctx context.Context, cfg aws.Config, stream return values, nil } -func WAFRegionalWebACL(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalWebACL(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListWebACLs(ctx, &wafregional.ListWebACLsInput{ NextMarker: prevToken, @@ -1059,7 +1060,7 @@ func WAFRegionalWebACL(ctx context.Context, cfg aws.Config, stream *StreamSender if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.WebACLId, Name: *v.Name, @@ -1088,11 +1089,11 @@ func WAFRegionalWebACL(ctx context.Context, cfg aws.Config, stream *StreamSender return values, nil } -func WAFWebACL(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFWebACL(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := waf.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListWebACLs(ctx, &waf.ListWebACLsInput{ NextMarker: prevToken, @@ -1132,7 +1133,7 @@ func WAFWebACL(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.WebACLId, Name: *v.Name, @@ -1161,11 +1162,11 @@ func WAFWebACL(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Res return values, nil } -func WAFRegionalXssMatchSet(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRegionalXssMatchSet(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wafregional.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListXssMatchSets(ctx, &wafregional.ListXssMatchSetsInput{ NextMarker: prevToken, @@ -1175,7 +1176,7 @@ func WAFRegionalXssMatchSet(ctx context.Context, cfg aws.Config, stream *StreamS } for _, v := range output.XssMatchSets { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.XssMatchSetId, Name: *v.Name, @@ -1199,10 +1200,10 @@ func WAFRegionalXssMatchSet(ctx context.Context, cfg aws.Config, stream *StreamS return values, nil } -func WAFRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRule(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := waf.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListRules(ctx, &waf.ListRulesInput{ NextMarker: prevToken, @@ -1219,7 +1220,7 @@ func WAFRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { continue } @@ -1242,7 +1243,7 @@ func WAFRule(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resou return values, nil } -func wAFRuleHandle(ctx context.Context, cfg aws.Config, roleId string) (Resource, error) { +func wAFRuleHandle(ctx context.Context, cfg aws.Config, roleId string) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := waf.NewFromConfig(cfg) @@ -1251,9 +1252,9 @@ func wAFRuleHandle(ctx context.Context, cfg aws.Config, roleId string) (Resource }) if err != nil { if !isErr(err, "WAFNonexistentItemException") { - return Resource{}, err + return models.Resource{}, err } - return Resource{}, nil + return models.Resource{}, nil } arn := fmt.Sprintf("arn:%s:waf::%s:rule/%s", describeCtx.Partition, describeCtx.AccountID, roleId) @@ -1263,14 +1264,14 @@ func wAFRuleHandle(ctx context.Context, cfg aws.Config, roleId string) (Resource }) if err != nil { if !isErr(err, "WAFNonexistentItemException") { - return Resource{}, err + return models.Resource{}, err } tags = &waf.ListTagsForResourceOutput{ - TagInfoForResource: &waftypes.TagInfoForResource{}, + TagInfoForResource: &waftypes.TagInfoFormodels.Resource{}, } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *rule.Rule.Name, @@ -1282,15 +1283,15 @@ func wAFRuleHandle(ctx context.Context, cfg aws.Config, roleId string) (Resource return resource, nil } -func GetWAFRule(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetWAFRule(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { ruleId := fields["id"] - var values []Resource + var values []models.Resource resource, err := wAFRuleHandle(ctx, cfg, ruleId) if err != nil { return nil, err } - emptyResource := Resource{} + emptyResource := models.Resource{} if err == nil && resource == emptyResource { return nil, nil } @@ -1298,12 +1299,12 @@ func GetWAFRule(ctx context.Context, cfg aws.Config, fields map[string]string) ( return values, nil } -func WAFRuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WAFRuleGroup(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := waf.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.ListRuleGroups(ctx, &waf.ListRuleGroupsInput{ NextMarker: prevToken, @@ -1339,7 +1340,7 @@ func WAFRuleGroup(ctx context.Context, cfg aws.Config, stream *StreamSender) ([] return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Description: model.WAFRuleGroupDescription{ diff --git a/provider/describer/wellarchitected.go b/provider/describer/wellarchitected.go index 96d58cc5..7e93b27f 100755 --- a/provider/describer/wellarchitected.go +++ b/provider/describer/wellarchitected.go @@ -2,6 +2,7 @@ package describer import ( "context" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "reflect" "github.com/aws/aws-sdk-go-v2/aws" @@ -10,12 +11,12 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func WellArchitectedWorkload(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedWorkload(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListWorkloadsPaginator(client, &wellarchitected.ListWorkloadsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -37,7 +38,7 @@ func WellArchitectedWorkload(ctx context.Context, cfg aws.Config, stream *Stream } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.WorkloadArn, Name: *v.WorkloadName, @@ -58,12 +59,12 @@ func WellArchitectedWorkload(ctx context.Context, cfg aws.Config, stream *Stream return values, nil } -func WellArchitectedAnswer(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedAnswer(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListWorkloadsPaginator(client, &wellarchitected.ListWorkloadsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -99,7 +100,7 @@ func WellArchitectedAnswer(ctx context.Context, cfg aws.Config, stream *StreamSe return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedAnswerDescription{ Answer: *op.Answer, @@ -125,7 +126,7 @@ func WellArchitectedAnswer(ctx context.Context, cfg aws.Config, stream *StreamSe return values, nil } -func WellArchitectedCheckDetail(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedCheckDetail(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) answers, err := WellArchitectedAnswer(ctx, cfg, stream) @@ -136,7 +137,7 @@ func WellArchitectedCheckDetail(ctx context.Context, cfg aws.Config, stream *Str return nil, err } } - var values []Resource + var values []models.Resource for _, answer := range answers { des := answer.Description.(model.WellArchitectedAnswerDescription) params := &wellarchitected.GetAnswerInput{ @@ -176,7 +177,7 @@ func WellArchitectedCheckDetail(ctx context.Context, cfg aws.Config, stream *Str } for _, c := range page.CheckDetails { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: des.WorkloadName, Description: model.WellArchitectedCheckDetailDescription{ @@ -199,7 +200,7 @@ func WellArchitectedCheckDetail(ctx context.Context, cfg aws.Config, stream *Str return values, nil } -func WellArchitectedCheckSummary(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedCheckSummary(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) answers, err := WellArchitectedAnswer(ctx, cfg, stream) @@ -210,7 +211,7 @@ func WellArchitectedCheckSummary(ctx context.Context, cfg aws.Config, stream *St return nil, err } } - var values []Resource + var values []models.Resource for _, answer := range answers { des := answer.Description.(model.WellArchitectedAnswerDescription) params := &wellarchitected.GetAnswerInput{ @@ -246,7 +247,7 @@ func WellArchitectedCheckSummary(ctx context.Context, cfg aws.Config, stream *St } for _, c := range page.CheckSummaries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Name: *c.Name, Description: model.WellArchitectedCheckSummaryDescription{ @@ -269,10 +270,10 @@ func WellArchitectedCheckSummary(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func WellArchitectedConsolidatedReport(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedConsolidatedReport(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) - var values []Resource + var values []models.Resource for _, rFormat := range []types.ReportFormat{types.ReportFormatPdf, types.ReportFormatJson} { input := &wellarchitected.GetConsolidatedReportInput{ IncludeSharedResources: aws.Bool(true), @@ -308,7 +309,7 @@ func WellArchitectedConsolidatedReport(ctx context.Context, cfg aws.Config, stre return values, nil } -func Contains(values []Resource, value Resource) bool { +func Contains(values []models.Resource, value models.Resource) bool { for _, v := range values { val := v.Description.(model.WellArchitectedCheckConsolidatedReportDescription) val1 := value.Description.(model.WellArchitectedCheckConsolidatedReportDescription) @@ -319,10 +320,10 @@ func Contains(values []Resource, value Resource) bool { return false } -func WellArchitectedConsolidatedReportHelper(ctx context.Context, cfg aws.Config, stream *StreamSender, client *wellarchitected.Client, describeCtx DescribeContext, input *wellarchitected.GetConsolidatedReportInput) ([]Resource, error) { +func WellArchitectedConsolidatedReportHelper(ctx context.Context, cfg aws.Config, stream *models.StreamSender, client *wellarchitected.Client, describeCtx DescribeContext, input *wellarchitected.GetConsolidatedReportInput) ([]models.Resource, error) { paginator := wellarchitected.NewGetConsolidatedReportPaginator(client, input) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -334,7 +335,7 @@ func WellArchitectedConsolidatedReportHelper(ctx context.Context, cfg aws.Config } for _, v := range page.Metrics { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedCheckConsolidatedReportDescription{ IncludeSharedResources: input.IncludeSharedResources, @@ -354,12 +355,12 @@ func WellArchitectedConsolidatedReportHelper(ctx context.Context, cfg aws.Config return values, nil } -func WellArchitectedLens(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedLens(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListLensesPaginator(client, &wellarchitected.ListLensesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -385,7 +386,7 @@ func WellArchitectedLens(ctx context.Context, cfg aws.Config, stream *StreamSend } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: *v.LensArn, Description: model.WellArchitectedLensDescription{ @@ -408,12 +409,12 @@ func WellArchitectedLens(ctx context.Context, cfg aws.Config, stream *StreamSend return values, nil } -func WellArchitectedLensReview(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedLensReview(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListWorkloadsPaginator(client, &wellarchitected.ListWorkloadsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -446,7 +447,7 @@ func WellArchitectedLensReview(ctx context.Context, cfg aws.Config, stream *Stre return nil, err } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedLensReviewDescription{ LensReview: *review.LensReview, @@ -465,12 +466,12 @@ func WellArchitectedLensReview(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func WellArchitectedLensReviewImprovement(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedLensReviewImprovement(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListWorkloadsPaginator(client, &wellarchitected.ListWorkloadsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -496,7 +497,7 @@ func WellArchitectedLensReviewImprovement(ctx context.Context, cfg aws.Config, s } } for _, improvement := range output.ImprovementSummaries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedLensReviewImprovementDescription{ LensAlias: *output.LensAlias, @@ -521,12 +522,12 @@ func WellArchitectedLensReviewImprovement(ctx context.Context, cfg aws.Config, s return values, nil } -func WellArchitectedLensReviewReport(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedLensReviewReport(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListWorkloadsPaginator(client, &wellarchitected.ListWorkloadsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -550,7 +551,7 @@ func WellArchitectedLensReviewReport(ctx context.Context, cfg aws.Config, stream } } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedLensReviewReportDescription{ Report: *report.LensReviewReport, @@ -572,7 +573,7 @@ func WellArchitectedLensReviewReport(ctx context.Context, cfg aws.Config, stream return values, nil } -func WellArchitectedLensShare(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedLensShare(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) @@ -580,7 +581,7 @@ func WellArchitectedLensShare(ctx context.Context, cfg aws.Config, stream *Strea if err != nil { return nil, err } - var values []Resource + var values []models.Resource for _, v := range lenses { lens := v.Description.(model.WellArchitectedLensDescription).Lens input := &wellarchitected.ListLensSharesInput{ @@ -597,7 +598,7 @@ func WellArchitectedLensShare(ctx context.Context, cfg aws.Config, stream *Strea } } for _, share := range page.LensShareSummaries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedLensShareDescription{ Lens: lens, @@ -617,12 +618,12 @@ func WellArchitectedLensShare(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func WellArchitectedMilestone(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedMilestone(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListWorkloadsPaginator(client, &wellarchitected.ListWorkloadsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -649,7 +650,7 @@ func WellArchitectedMilestone(ctx context.Context, cfg aws.Config, stream *Strea if err != nil { return nil, err } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedMilestoneDescription{ Milestone: *milestone.Milestone, @@ -669,12 +670,12 @@ func WellArchitectedMilestone(ctx context.Context, cfg aws.Config, stream *Strea return values, nil } -func WellArchitectedNotification(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedNotification(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListNotificationsPaginator(client, &wellarchitected.ListNotificationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -682,7 +683,7 @@ func WellArchitectedNotification(ctx context.Context, cfg aws.Config, stream *St } for _, v := range page.NotificationSummaries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedNotificationDescription{ Notification: v, @@ -700,12 +701,12 @@ func WellArchitectedNotification(ctx context.Context, cfg aws.Config, stream *St return values, nil } -func WellArchitectedShareInvitation(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedShareInvitation(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListShareInvitationsPaginator(client, &wellarchitected.ListShareInvitationsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -716,7 +717,7 @@ func WellArchitectedShareInvitation(ctx context.Context, cfg aws.Config, stream } } for _, v := range page.ShareInvitationSummaries { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedShareInvitationDescription{ ShareInvitation: v, @@ -734,12 +735,12 @@ func WellArchitectedShareInvitation(ctx context.Context, cfg aws.Config, stream return values, nil } -func WellArchitectedWorkloadShare(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WellArchitectedWorkloadShare(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := wellarchitected.NewFromConfig(cfg) paginator := wellarchitected.NewListWorkloadsPaginator(client, &wellarchitected.ListWorkloadsInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -765,7 +766,7 @@ func WellArchitectedWorkloadShare(ctx context.Context, cfg aws.Config, stream *S for _, m := range output.WorkloadShareSummaries { arn := "arn:" + describeCtx.Partition + ":waf::" + describeCtx.AccountID + ":ratebasedrule" + "/" + *m.ShareId - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, Description: model.WellArchitectedWorkloadShareDescription{ Share: m, diff --git a/provider/describer/workspace.go b/provider/describer/workspace.go index cb58d2fa..00b93510 100755 --- a/provider/describer/workspace.go +++ b/provider/describer/workspace.go @@ -3,6 +3,7 @@ package describer import ( "context" "fmt" + "github.com/opengovern/og-describer-aws/pkg/sdk/models" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/workspaces" @@ -10,11 +11,11 @@ import ( "github.com/opengovern/og-describer-aws/provider/model" ) -func WorkSpacesConnectionAlias(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WorkSpacesConnectionAlias(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := workspaces.NewFromConfig(cfg) - var values []Resource + var values []models.Resource err := PaginateRetrieveAll(func(prevToken *string) (nextToken *string, err error) { output, err := client.DescribeConnectionAliases(ctx, &workspaces.DescribeConnectionAliasesInput{ NextToken: prevToken, @@ -24,7 +25,7 @@ func WorkSpacesConnectionAlias(ctx context.Context, cfg aws.Config, stream *Stre } for _, v := range output.ConnectionAliases { - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ID: *v.AliasId, Name: *v.AliasId, @@ -49,11 +50,11 @@ func WorkSpacesConnectionAlias(ctx context.Context, cfg aws.Config, stream *Stre return values, nil } -func WorkspacesWorkspace(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WorkspacesWorkspace(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := workspaces.NewFromConfig(cfg) paginator := workspaces.NewDescribeWorkspacesPaginator(client, &workspaces.DescribeWorkspacesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -80,7 +81,7 @@ func WorkspacesWorkspace(ctx context.Context, cfg aws.Config, stream *StreamSend } return values, nil } -func workspacesWorkspaceHandle(ctx context.Context, cfg aws.Config, v types.Workspace) (Resource, error) { +func workspacesWorkspaceHandle(ctx context.Context, cfg aws.Config, v types.Workspace) (models.Resource, error) { describeCtx := GetDescribeContext(ctx) client := workspaces.NewFromConfig(cfg) @@ -90,12 +91,12 @@ func workspacesWorkspaceHandle(ctx context.Context, cfg aws.Config, v types.Work }) if err != nil { if !isErr(err, "ValidationException") { - return Resource{}, err + return models.Resource{}, err } tags = &workspaces.DescribeTagsOutput{} } - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.WorkspaceId, @@ -106,10 +107,10 @@ func workspacesWorkspaceHandle(ctx context.Context, cfg aws.Config, v types.Work } return resource, nil } -func GetWorkspacesWorkspace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { +func GetWorkspacesWorkspace(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { client := workspaces.NewFromConfig(cfg) workspaceId := fields["workspaceId"] - var values []Resource + var values []models.Resource workspace, err := client.DescribeWorkspaces(ctx, &workspaces.DescribeWorkspacesInput{ WorkspaceIds: []string{workspaceId}, }) @@ -131,11 +132,11 @@ func GetWorkspacesWorkspace(ctx context.Context, cfg aws.Config, fields map[stri return values, nil } -func WorkspacesBundle(ctx context.Context, cfg aws.Config, stream *StreamSender) ([]Resource, error) { +func WorkspacesBundle(ctx context.Context, cfg aws.Config, stream *models.StreamSender) ([]models.Resource, error) { client := workspaces.NewFromConfig(cfg) paginator := workspaces.NewDescribeWorkspaceBundlesPaginator(client, &workspaces.DescribeWorkspaceBundlesInput{}) - var values []Resource + var values []models.Resource for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) if err != nil { @@ -163,10 +164,10 @@ func WorkspacesBundle(ctx context.Context, cfg aws.Config, stream *StreamSender) return values, nil } -func workspacesBundleHandle(ctx context.Context, v types.WorkspaceBundle, tags *workspaces.DescribeTagsOutput) Resource { +func workspacesBundleHandle(ctx context.Context, v types.WorkspaceBundle, tags *workspaces.DescribeTagsOutput) models.Resource { describeCtx := GetDescribeContext(ctx) arn := fmt.Sprintf("arn:%s:workspaces:%s:%s:workspacebundle/%s", describeCtx.Partition, describeCtx.Region, describeCtx.AccountID, *v.BundleId) - resource := Resource{ + resource := models.Resource{ Region: describeCtx.OGRegion, ARN: arn, Name: *v.BundleId, @@ -177,8 +178,8 @@ func workspacesBundleHandle(ctx context.Context, v types.WorkspaceBundle, tags * } return resource } -func GetWorkspacesBundle(ctx context.Context, cfg aws.Config, fields map[string]string) ([]Resource, error) { - var values []Resource +func GetWorkspacesBundle(ctx context.Context, cfg aws.Config, fields map[string]string) ([]models.Resource, error) { + var values []models.Resource BundleId := fields["bundleId"] client := workspaces.NewFromConfig(cfg) diff --git a/steampipe-plugin-aws/aws/common_columns.go b/steampipe-plugin-aws/aws/common_columns.go index 27bbf8b8..34fc8681 100644 --- a/steampipe-plugin-aws/aws/common_columns.go +++ b/steampipe-plugin-aws/aws/common_columns.go @@ -92,7 +92,7 @@ func commonAwsKaytuRegionalColumns() []*plugin.Column { Name: "og_account_id", Type: proto.ColumnType_STRING, Description: "The Platform Account ID in which the resource is located.", - Transform: transform.FromField("Metadata.SourceID"), + Transform: transform.FromField("Metadata.IntegrationID"), }, { Name: "og_resource_id", diff --git a/steampipe-plugin-aws/aws/table_aws_ec2_ami.go b/steampipe-plugin-aws/aws/table_aws_ec2_ami.go index b96742c7..ae940151 100644 --- a/steampipe-plugin-aws/aws/table_aws_ec2_ami.go +++ b/steampipe-plugin-aws/aws/table_aws_ec2_ami.go @@ -3,6 +3,7 @@ package aws import ( "context" + opengovernance "github.com/opengovern/og-describer-aws/pkg/sdk/es" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" diff --git a/steampipe-plugin-aws/aws/table_aws_ec2_ami_shared.go b/steampipe-plugin-aws/aws/table_aws_ec2_ami_shared.go index 9815a48c..3513e311 100644 --- a/steampipe-plugin-aws/aws/table_aws_ec2_ami_shared.go +++ b/steampipe-plugin-aws/aws/table_aws_ec2_ami_shared.go @@ -3,6 +3,7 @@ package aws import ( "context" + opengovernance "github.com/opengovern/og-describer-aws/pkg/sdk/es" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" diff --git a/steampipe-plugin-aws/aws/table_aws_ecr_image.go b/steampipe-plugin-aws/aws/table_aws_ecr_image.go index c57c29c3..6d7361b7 100644 --- a/steampipe-plugin-aws/aws/table_aws_ecr_image.go +++ b/steampipe-plugin-aws/aws/table_aws_ecr_image.go @@ -3,6 +3,7 @@ package aws import ( "context" + opengovernance "github.com/opengovern/og-describer-aws/pkg/sdk/es" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" diff --git a/steampipe-plugin-aws/aws/table_aws_ecr_image_scan_finding.go b/steampipe-plugin-aws/aws/table_aws_ecr_image_scan_finding.go index fb611418..f7ad3e14 100644 --- a/steampipe-plugin-aws/aws/table_aws_ecr_image_scan_finding.go +++ b/steampipe-plugin-aws/aws/table_aws_ecr_image_scan_finding.go @@ -3,6 +3,7 @@ package aws import ( "context" + opengovernance "github.com/opengovern/og-describer-aws/pkg/sdk/es" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" diff --git a/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization.go b/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization.go index c59e83b8..0425f6ad 100644 --- a/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization.go +++ b/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization.go @@ -4,6 +4,7 @@ import ( "context" "strings" + opengovernance "github.com/opengovern/og-describer-aws/pkg/sdk/es" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" diff --git a/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization_daily.go b/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization_daily.go index 47b04182..94caec85 100644 --- a/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization_daily.go +++ b/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization_daily.go @@ -4,6 +4,7 @@ import ( "context" "strings" + opengovernance "github.com/opengovern/og-describer-aws/pkg/sdk/es" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" diff --git a/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization_hourly.go b/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization_hourly.go index af397ce1..2d560804 100644 --- a/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization_hourly.go +++ b/steampipe-plugin-aws/aws/table_aws_ecs_cluster_metric_cpu_utilization_hourly.go @@ -2,11 +2,11 @@ package aws import ( "context" - "strings" - + opengovernance "github.com/opengovern/og-describer-aws/pkg/sdk/es" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" + "strings" ) //// TABLE DEFINITION diff --git a/steampipe-plugin-aws/aws/table_aws_iam_access_key.go b/steampipe-plugin-aws/aws/table_aws_iam_access_key.go index e34fa518..ce647f4f 100644 --- a/steampipe-plugin-aws/aws/table_aws_iam_access_key.go +++ b/steampipe-plugin-aws/aws/table_aws_iam_access_key.go @@ -83,7 +83,7 @@ func tableAwsIamAccessKey(_ context.Context) *plugin.Table { //// HYDRATE FUNCTIONS func getIamAccessKeyAka(ctx context.Context, d *transform.TransformData) (interface{}, error) { - arn := d.HydrateItem.(opengovernance.IAMAccessKey).ARN + arn := d.HydrateItem.(opengovernance.IAMAccessKey).ResourceID aka := []string{arn} return aka, nil diff --git a/steampipe-plugin-aws/aws/table_aws_iam_ssh_public_key.go b/steampipe-plugin-aws/aws/table_aws_iam_ssh_public_key.go index 8d41a801..9aea73ce 100644 --- a/steampipe-plugin-aws/aws/table_aws_iam_ssh_public_key.go +++ b/steampipe-plugin-aws/aws/table_aws_iam_ssh_public_key.go @@ -61,7 +61,7 @@ func tableAwsIamSshPublicKey(_ context.Context) *plugin.Table { } func getIamSSHPublicKeyAka(ctx context.Context, d *transform.TransformData) (interface{}, error) { - arn := d.HydrateItem.(opengovernance.IAMSSHPublicKey).ARN + arn := d.HydrateItem.(opengovernance.IAMSSHPublicKey).Description.SSHPublicKeyKey.SSHPublicKeyId aka := []string{arn} return aka, nil