Skip to content

Commit 0fc7fae

Browse files
Fix ArgoCD minor issues (cloudposse/terraform-aws-components#571)
Co-authored-by: cloudpossebot <[email protected]>
1 parent c21911d commit 0fc7fae

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ This component is responsible for provisioning [Argo CD](https://argoproj.github
44

55
Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
66

7-
> :warning::warning::warning: ArgoCD CRDs must be installed separately from this component/helm release. :warning::warning::warning:
8-
```shell
9-
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=<appVersion>"
10-
11-
# Eg. version v2.4.9
12-
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=v2.4.9"
13-
```
7+
> :warning::warning::warning: Initial install needs run `deploy` two times because first run will create ArgoCD CRDs
8+
> and second run will finish ArgoCD configuration. :warning::warning::warning:
149
1510
## Usage
1611

@@ -61,6 +56,7 @@ components:
6156
|------|---------|
6257
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
6358
| <a name="provider_aws.config_secrets"></a> [aws.config\_secrets](#provider\_aws.config\_secrets) | >= 4.0 |
59+
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.9.0 |
6460
6561
## Modules
6662
@@ -87,6 +83,7 @@ components:
8783
| [aws_ssm_parameter.oidc_client_id](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source |
8884
| [aws_ssm_parameter.oidc_client_secret](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameter) | data source |
8985
| [aws_ssm_parameters_by_path.argocd_notifications](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssm_parameters_by_path) | data source |
86+
| [kubernetes_resources.example](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/resources) | data source |
9087
9188
## Inputs
9289

src/main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ module "argocd" {
225225
context = module.this.context
226226
}
227227

228+
data "kubernetes_resources" "example" {
229+
api_version = "apiextensions.k8s.io/v1"
230+
kind = "CustomResourceDefinition"
231+
field_selector = "metadata.name==applications.argoproj.io"
232+
}
233+
228234
module "argocd_apps" {
229235
source = "cloudposse/helm-release/aws"
230236
version = "0.3.0"
@@ -240,7 +246,7 @@ module "argocd_apps" {
240246
atomic = var.atomic
241247
cleanup_on_fail = var.cleanup_on_fail
242248
timeout = var.timeout
243-
enabled = local.enabled && var.argocd_apps_enabled
249+
enabled = local.enabled && var.argocd_apps_enabled && length(data.kubernetes_resources.example.objects) > 0
244250
values = compact([
245251
templatefile(
246252
"${path.module}/resources/argocd-apps-values.yaml.tpl",

0 commit comments

Comments
 (0)