Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

feat: FSx file-systems, aliases, DRAs #1273

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions client/mocks/mock_fsx.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ type FirehoseClient interface {
//go:generate mockgen -package=mocks -destination=./mocks/mock_fsx.go . FsxClient
type FsxClient interface {
DescribeBackups(ctx context.Context, params *fsx.DescribeBackupsInput, optFns ...func(*fsx.Options)) (*fsx.DescribeBackupsOutput, error)
DescribeFileSystems(ctx context.Context, params *fsx.DescribeFileSystemsInput, optFns ...func(*fsx.Options)) (*fsx.DescribeFileSystemsOutput, error)
DescribeFileSystemAliases(ctx context.Context, params *fsx.DescribeFileSystemAliasesInput, optFns ...func(*fsx.Options)) (*fsx.DescribeFileSystemAliasesOutput, error)
}

//go:generate mockgen -package=mocks -destination=./mocks/glue.go . GlueClient
Expand Down
11 changes: 11 additions & 0 deletions docs/tables/aws_fsx_file_system_administrative_actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Table: aws_fsx_file_system_administrative_actions
A list of administrative actions for the file system that are in process or waiting to be processed.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|fsx_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_systems table (FK)|
|action_type|text|Describes the type of administrative action.|
|progress_percent|integer|The percentage-complete status of a STORAGE_OPTIMIZATION administrative action.|
|request_time|timestamp without time zone|The time that the administrative action request was received.|
|status|text|Describes the status of the administrative action.|
9 changes: 9 additions & 0 deletions docs/tables/aws_fsx_file_system_aliases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# Table: aws_fsx_file_system_aliases
DNS aliases that are currently associated with the Amazon FSx file system.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|fsx_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_systems table (FK)|
|name|text|The name of the DNS alias.|
|lifecycle|text|The lifecycle status of DNS alias.|
10 changes: 10 additions & 0 deletions docs/tables/aws_fsx_file_system_audit_log_configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# Table: aws_fsx_file_system_audit_log_configs
The configuration that Amazon FSx for Windows File Server uses to audit and log user accesses of files, folders, and file shares on the Amazon FSx for Windows File Server file system.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|fsx_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_systems table (FK)|
|file_access_audit_log_level|text|Sets which attempt type is logged by Amazon FSx for file and folder accesses.|
|file_share_access_audit_log_level|text|Sets which attempt type is logged by Amazon FSx for file share accesses.|
|audit_log_destination|text|The Amazon Resource Name (ARN) for the destination of the audit logs.|
19 changes: 19 additions & 0 deletions docs/tables/aws_fsx_file_system_lustre_configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# Table: aws_fsx_file_system_lustre_configs
The configuration for the Amazon FSx for Lustre file system.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|fsx_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_systems table (FK)|
|deployment_type|text|The deployment type of the FSx for Lustre file system.|
|per_unit_storage_throughput|integer|Per unit storage throughput represents the megabytes per second of read or write throughput per 1 tebibyte of storage provisioned.|
|mount_name|integer|Mount name of the FSx Lustre file system.|
|daily_automatic_backup_start_time|text|A recurring daily time, in the format HH:MM.|
|automatic_backup_retention_days|integer|The number of days to retain automatic backups.|
|copy_tags_to_backups|boolean|A boolean flag indicating whether tags on the file system are copied to backups.|
|drive_cache_type|text|The type of drive cache used by PERSISTENT_1 file systems that are provisioned with HDD storage devices.|
|data_compression_type|text|The data compression configuration for the file system.|
|log_level|text|The data repository events that are logged by Amazon FSx.|
|log_destination|text|The Amazon Resource Name (ARN) that specifies the destination of the logs.|
|root_squash|text|You enable root squash by setting a user ID (UID) and group ID (GID) for the file system in the format UID:GID (for example, 365534:65534 ).|
|no_squash_nids|integer[]|When root squash is enabled, you can optionally specify an array of NIDs of clients for which root squash does not apply.|
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Table: aws_fsx_file_system_lustre_data_repository_associations
The data repository configuration object for Lustre file systems returned in the response of the CreateFileSystem operation.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|lustre_config_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_system_lustre_configs table (FK)|
|import_path|text|The import path to the Amazon S3 bucket (and optional prefix) that you're using as the data repository for your FSx for Lustre file system.|
|export_path|text|The export path to the Amazon S3 bucket (and prefix) that you are using to store new and changed Lustre file system files in S3.|
|imported_file_chunk_size|integer|For files imported from a data repository, this value determines the stripe count and maximum amount of data per file (in MiB) stored on a single physical disk.|
|auto_import_policy|text|Describes the file system's linked S3 data repository's AutoImportPolicy. The AutoImportPolicy configures how Amazon FSx keeps your file and directory listings up to date as you add or modify objects in your linked S3 bucket.|
|failure_details_message|text|A message describing the data repository association failure.|
21 changes: 21 additions & 0 deletions docs/tables/aws_fsx_file_system_ontap_configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# Table: aws_fsx_file_system_ontap_configs
The configuration for this Amazon FSx for NetApp ONTAP file system.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|fsx_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_systems table (FK)|
|automatic_backup_retention_days|integer|The number of days to retain automatic backups.|
|daily_automatic_backup_start_time|text|A recurring daily time, in the format HH:MM.|
|deployment_type|text|Specifies the FSx for ONTAP file system deployment type in use in the file system.|
|endpoint_ip_address_range|text|(Multi-AZ only) The IP address range in which the endpoints to access your file system are created.|
|intercluster_dns_name|text|The Domain Name Service (DNS) name for the file system intercluster endpoint.|
|intercluster_ip_addresses|text|IP addresses of the file system intercluster endpoint.|
|management_dns_name|text|The Domain Name Service (DNS) name for the file system management endpoint.|
|management_ip_addresses|text|IP addresses of the file system management endpoint.|
|disk_iops_mode|text|Specifies whether the number of IOPS for the file system is using the system default (AUTOMATIC) or was provisioned by the customer (USER_PROVISIONED).|
|disk_iops|float|The total number of SSD IOPS provisioned for the file system.|
|preferred_subnet_id|text|The ID for a subnet.|
|route_table_ids|text[]|(Multi-AZ only) The VPC route tables in which your file system's endpoints are created.|
|throughput_capacity|integer|The sustained throughput of an Amazon FSx file system in Megabytes per second (MBps).|
|weekly_maintenance_start_time|text|A recurring weekly time, in the format D:HH:MM .|
16 changes: 16 additions & 0 deletions docs/tables/aws_fsx_file_system_openzfs_configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# Table: aws_fsx_file_system_openzfs_configs
The configuration for this Amazon FSx for OpenZFS file system.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|fsx_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_systems table (FK)|
|automatic_backup_retention_days|integer|The number of days to retain automatic backups.|
|copy_tags_to_backups|boolean|A boolean flag indicating whether tags on the file system should be copied to backups.|
|copy_tags_to_volumes|boolean|A Boolean value indicating whether tags for the volume should be copied to snapshots.|
|daily_automatic_backup_start_time|text|A recurring daily time, in the format HH:MM.|
|deployment_type|text|Specifies the file-system deployment type.|
|throughput_capacity|integer|The sustained throughput of an Amazon FSx file system in Megabytes per second (MBps).|
|weekly_maintenance_start_time|text|A recurring weekly time, in the format D:HH:MM .|
|disk_iops_mode|text|Specifies whether the number of IOPS for the file system is using the system default (AUTOMATIC) or was provisioned by the customer (USER_PROVISIONED).|
|disk_iops|float|The total number of SSD IOPS provisioned for the file system.|
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# Table: aws_fsx_file_system_self_managed_active_directory_configs
The configuration of the self-managed Microsoft Active Directory (AD) directory to which the Windows File Server or ONTAP storage virtual machine (SVM) instance is joined.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|windows_config_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_system_windows_configs table (FK)|
|active_directory_id|text|The Active Directory ID.|
|domain_name|text|The fully qualified domain name of the self-managed AD directory.|
|organizational_unit_distinguished_id|text|The fully qualified distinguished name of the organizational unit within the self-managed AD directory to which the Windows File Server or ONTAP storage virtual machine (SVM) instance is joined.|
|file_system_administrators_group|text|The name of the domain group whose members have administrative privileges for the FSx file system.|
|user_name|text|The user name for the service account on your self-managed AD domain that FSx uses to join to your AD domain.|
|dns_ips|text[]|A list of up to three IP addresses of DNS servers or domain controllers in the self-managed AD directory.|
18 changes: 18 additions & 0 deletions docs/tables/aws_fsx_file_system_windows_configs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# Table: aws_fsx_file_system_windows_configs
The configuration for this Amazon FSx for Windows File Server file system.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|fsx_cq_id|uuid|Unique CloudQuery ID of aws_fsx_file_systems table (FK)|
|active_directory_id|text|The ID for an existing Amazon Web Services Managed Microsoft Active Directory instance that the file system is joined to.|
|deployment_type|text|Specifies the file system deployment type.|
|remote_administration_endpoint|text|Specifies the file system remote administration endpoint.|
|preferred_subnet_id|text|Specifies the file system preferred subnet ID.|
|preferred_file_server_ip|text|Specifies the file system preferred file server IP.|
|throughput_capacity|integer|The throughput of the Amazon FSx file system, measured in megabytes per second.|
|maintenance_operations_in_progress|text[]|The list of maintenance operations in progress for this file system.|
|weekly_maintenance_start_time|text|The preferred start time to perform weekly maintenance, formatted d:HH:MM in the UTC time zone. d is the weekday number, from 1 through 7, beginning with Monday and ending with Sunday.|
|daily_automatic_backup_start_time|text|The preferred time to take daily automatic backups, in the UTC time zone.|
|automatic_backup_retention_days|integer|The number of days to retain automatic backups. Setting this to 0 disables automatic backups. You can retain automatic backups for a maximum of 90 days.|
|copy_tags_to_backups|boolean|A boolean flag indicating whether tags on the file system should be copied to backups.|
24 changes: 24 additions & 0 deletions docs/tables/aws_fsx_file_systems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# Table: aws_fsx_file_systems
An Amazon FSx file system.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|account_id|text|The AWS Account ID of the resource.|
|region|text|The AWS Region of the resource.|
|id|text|The system-generated, unique 17-digit ID of the file system.|
|creation_time|timestamp without time zone|The time that the file system was created.|
|owner_id|text|The AWS account that created the file system.|
|file_system_type|text|The type of Amazon FSx file system.|
|lifecycle|text|The lifecycle status of the file system.|
|failure_details_message|text|A message describing the data repository association failure.|
|storage_capacity|integer|The storage capacity of the file system in gibibytes (GiB).|
|storage_type|text|The type of storage the file system is using.|
|vpc_id|text|The ID of the primary virtual private cloud (VPC) for the file system.|
|subnet_ids|text[]|Specifies the IDs of the subnets that the file system is accessible from.|
|network_interface_ids|text[]|The IDs of the elastic network interfaces from which a specific file system is accessible.|
|dns_name|text|The Domain Name System (DNS) name for the file system.|
|kms_key_id|text|The ID of the Key Management Service (KMS) key used to encrypt Amazon FSx file system data.|
|arn|text|The Amazon Resource Name (ARN) of the file system resource.|
|tags|jsonb|Tags associated with a particular file system.|
|file_system_type_version|text|The Lustre version of the Amazon FSx for Lustre file system, either 2.10 or 2.12 .|
1 change: 1 addition & 0 deletions resources/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func Provider() *provider.Provider {
"emr.clusters": emr.EmrClusters(),
"eventbridge.event_buses": eventbridge.EventBuses(),
"fsx.backups": fsx.FsxBackups(),
"fsx.filesystems": fsx.FsxFileSystems(),
"glue.classifiers": glue.Classifiers(),
"glue.connections": glue.Connections(),
"glue.crawlers": glue.Crawlers(),
Expand Down
36 changes: 36 additions & 0 deletions resources/services/fsx/backups_mock_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package fsx

import (
"testing"

"github.com/aws/aws-sdk-go-v2/service/fsx"
"github.com/aws/aws-sdk-go-v2/service/fsx/types"
"github.com/cloudquery/cq-provider-aws/client"
"github.com/cloudquery/cq-provider-aws/client/mocks"
"github.com/cloudquery/faker/v3"
"github.com/golang/mock/gomock"
)

func buildFSXClientForBackups(t *testing.T, ctrl *gomock.Controller) client.Services {
mock := mocks.NewMockFsxClient(ctrl)

var b types.Backup
if err := faker.FakeData(&b); err != nil {
t.Fatal(err)
}

mock.EXPECT().DescribeBackups(
gomock.Any(),
&fsx.DescribeBackupsInput{},
gomock.Any(),
).Return(
&fsx.DescribeBackupsOutput{Backups: []types.Backup{b}},
nil,
)

return client.Services{FSX: mock}
}

func TestFSXBackups(t *testing.T) {
client.AwsMockTestHelper(t, FsxBackups(), buildFSXClientForBackups, client.TestOptions{})
}
Loading