Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Byovpc gcp #213

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
95 changes: 94 additions & 1 deletion docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Required:
Optional:

- `aws` (Attributes) (see [below for nested schema](#nestedatt--customer_managed_resources--aws))
- `gcp` (Attributes) (see [below for nested schema](#nestedatt--customer_managed_resources--gcp))

<a id="nestedatt--customer_managed_resources--aws"></a>
### Nested Schema for `customer_managed_resources.aws`
Expand Down Expand Up @@ -303,6 +304,99 @@ Required:



<a id="nestedatt--customer_managed_resources--gcp"></a>
### Nested Schema for `customer_managed_resources.gcp`

Required:

- `agent_service_account` (Attributes) GCP service account for the agent. (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--agent_service_account))
- `connector_service_account` (Attributes) GCP service account for managed connectors. (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--connector_service_account))
- `console_service_account` (Attributes) GCP service account for Redpanda Console. (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--console_service_account))
- `gke_service_account` (Attributes) GCP service account for GCP Kubernetes Engine (GKE). (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--gke_service_account))
- `redpanda_cluster_service_account` (Attributes) GCP service account for the Redpanda cluster. (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--redpanda_cluster_service_account))
- `subnet` (Attributes) GCP subnet where Redpanda cluster is deployed. (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--subnet))
- `tiered_storage_bucket` (Attributes) GCP storage bucket for Tiered storage. (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--tiered_storage_bucket))

Optional:

- `psc_nat_subnet_name` (String) NAT subnet name if GCP Private Service Connect is enabled.

<a id="nestedatt--customer_managed_resources--gcp--agent_service_account"></a>
### Nested Schema for `customer_managed_resources.gcp.agent_service_account`

Required:

- `email` (String) GCP service account email.


<a id="nestedatt--customer_managed_resources--gcp--connector_service_account"></a>
### Nested Schema for `customer_managed_resources.gcp.connector_service_account`

Required:

- `email` (String) GCP service account email.


<a id="nestedatt--customer_managed_resources--gcp--console_service_account"></a>
### Nested Schema for `customer_managed_resources.gcp.console_service_account`

Required:

- `email` (String) GCP service account email.


<a id="nestedatt--customer_managed_resources--gcp--gke_service_account"></a>
### Nested Schema for `customer_managed_resources.gcp.gke_service_account`

Required:

- `email` (String) GCP service account email.


<a id="nestedatt--customer_managed_resources--gcp--redpanda_cluster_service_account"></a>
### Nested Schema for `customer_managed_resources.gcp.redpanda_cluster_service_account`

Required:

- `email` (String) GCP service account email.


<a id="nestedatt--customer_managed_resources--gcp--subnet"></a>
### Nested Schema for `customer_managed_resources.gcp.subnet`

Required:

- `k8s_master_ipv4_range` (String) Kubernetes Master IPv4 range, e.g. 10.0.0.0/24.
- `name` (String) Subnet name.
- `secondary_ipv4_range_pods` (Attributes) Secondary IPv4 range for pods. (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--subnet--secondary_ipv4_range_pods))
- `secondary_ipv4_range_services` (Attributes) Secondary IPv4 range for services. (see [below for nested schema](#nestedatt--customer_managed_resources--gcp--subnet--secondary_ipv4_range_services))

<a id="nestedatt--customer_managed_resources--gcp--subnet--secondary_ipv4_range_pods"></a>
### Nested Schema for `customer_managed_resources.gcp.subnet.secondary_ipv4_range_pods`

Required:

- `name` (String) Secondary IPv4 range name for pods.


<a id="nestedatt--customer_managed_resources--gcp--subnet--secondary_ipv4_range_services"></a>
### Nested Schema for `customer_managed_resources.gcp.subnet.secondary_ipv4_range_services`

Required:

- `name` (String) Secondary IPv4 range name for services.



<a id="nestedatt--customer_managed_resources--gcp--tiered_storage_bucket"></a>
### Nested Schema for `customer_managed_resources.gcp.tiered_storage_bucket`

Required:

- `name` (String) GCP storage bucket name.




<a id="nestedatt--gcp_private_service_connect"></a>
### Nested Schema for `gcp_private_service_connect`
Expand Down Expand Up @@ -1250,7 +1344,6 @@ module "redpanda_byovpc" {
source = "redpanda-data/redpanda-byovpc/aws"

region = var.region
aws_account_id = "879326078624"
public_subnet_cidrs = [
"10.0.16.0/20", "10.0.32.0/20", "10.0.48.0/20"
]
Expand Down
1 change: 0 additions & 1 deletion examples/byovpc/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module "redpanda_byovpc" {
source = "redpanda-data/redpanda-byovpc/aws"

region = var.region
aws_account_id = "879326078624"
public_subnet_cidrs = [
"10.0.16.0/20", "10.0.32.0/20", "10.0.48.0/20"
]
Expand Down
91 changes: 91 additions & 0 deletions examples/byovpc/aws/vpc/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
module "redpanda-byovpc" {
source = "redpanda-data/redpanda-byovpc/aws"
region = var.region

public_subnet_cidrs = [
"10.0.16.0/20", "10.0.32.0/20", "10.0.48.0/20"
]
}

provider "aws" {
region = var.region
}

variable "region" {
type = string
default = "us-east-2"
}

output "management_bucket_arn" {
value = module.redpanda-byovpc.management_bucket_arn
}

output "dynamodb_table_arn" {
value = module.redpanda-byovpc.dynamodb_table_arn
}

output "vpc_arn" {
value = module.redpanda-byovpc.vpc_arn
}

output "private_subnet_arns" {
value = module.redpanda-byovpc.private_subnet_arns
}

output "permissions_boundary_policy_arn" {
value = module.redpanda-byovpc.permissions_boundary_policy_arn
}

output "agent_instance_profile_arn" {
value = module.redpanda-byovpc.agent_instance_profile_arn
}

output "cloud_storage_bucket_arn" {
value = module.redpanda-byovpc.cloud_storage_bucket_arn
}

output "redpanda_agent_security_group_arn" {
value = module.redpanda-byovpc.redpanda_agent_security_group_arn
}

output "connectors_security_group_arn" {
value = module.redpanda-byovpc.connectors_security_group_arn
}

output "redpanda_node_group_security_group_arn" {
value = module.redpanda-byovpc.redpanda_node_group_security_group_arn
}

output "utility_security_group_arn" {
value = module.redpanda-byovpc.utility_security_group_arn
}

output "cluster_security_group_arn" {
value = module.redpanda-byovpc.cluster_security_group_arn
}

output "node_security_group_arn" {
value = module.redpanda-byovpc.node_security_group_arn
}

output "byovpc_rpk_user_policy_arns" {
value = module.redpanda-byovpc.byovpc_rpk_user_policy_arns
}

output "connectors_node_group_instance_profile_arn" {
value = module.redpanda-byovpc.connectors_node_group_instance_profile_arn
}

output "utility_node_group_instance_profile_arn" {
value = module.redpanda-byovpc.utility_node_group_instance_profile_arn
}

output "redpanda_node_group_instance_profile_arn" {
value = module.redpanda-byovpc.redpanda_node_group_instance_profile_arn
}

output "k8s_cluster_role_arn" {
value = module.redpanda-byovpc.k8s_cluster_role_arn
}


12 changes: 3 additions & 9 deletions redpanda/resources/acl/resource_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ type ACL struct {

// Ensure provider defined types fully satisfy framework interfaces.
var (
_ resource.Resource = &ACL{}
_ resource.ResourceWithConfigure = &ACL{}
_ resource.ResourceWithImportState = &ACL{}
_ resource.Resource = &ACL{}
_ resource.ResourceWithConfigure = &ACL{}
)

// Metadata returns the metadata for the resource.
Expand Down Expand Up @@ -166,7 +165,7 @@ func (a *ACL) Create(ctx context.Context, request resource.CreateRequest, respon
return
}
defer a.dataplaneConn.Close()
// TODO doesn't return an acl object in the response, check on this
// FTODO doesn't return an acl object in the response, check on this
_, err = a.ACLClient.CreateACL(ctx, &dataplanev1alpha2.CreateACLRequest{
ResourceType: resourceType,
ResourceName: model.ResourceName.ValueString(),
Expand Down Expand Up @@ -330,11 +329,6 @@ func (a *ACL) Delete(ctx context.Context, request resource.DeleteRequest, respon
response.State.RemoveResource(ctx)
}

// ImportState imports an ACL resource
func (*ACL) ImportState(_ context.Context, _ resource.ImportStateRequest, _ *resource.ImportStateResponse) {
// TODO implement me.
}

func (a *ACL) createACLClient(clusterURL string) error {
if a.ACLClient != nil { // Client already started, no need to create another one.
return nil
Expand Down
Loading