From 6aa5983821586e2e35b88e873f24613900ae5c44 Mon Sep 17 00:00:00 2001 From: Fede Barcelona Date: Thu, 7 Jan 2021 17:37:11 +0100 Subject: [PATCH] feat: Import resources (#70) * feat: Add import capabilities for all resources * chore: Update dependencies * docs: Add documentation about how to import each resource * chore: Remove examples directory With the existing documentation, the examples directory is not needed anymore and would require maintenance in the future, so they are being removed. --- examples/alert.tf | 76 ------------------- examples/notification.tf | 50 ------------ examples/policy.tf | 19 ----- examples/rules.tf | 70 ----------------- examples/team.tf | 19 ----- examples/user.tf | 6 -- go.mod | 6 +- go.sum | 10 +++ .../resource_sysdig_monitor_alert_anomaly.go | 3 + ...ource_sysdig_monitor_alert_anomaly_test.go | 5 ++ .../resource_sysdig_monitor_alert_downtime.go | 3 + ...urce_sysdig_monitor_alert_downtime_test.go | 5 ++ sysdig/resource_sysdig_monitor_alert_event.go | 3 + ...esource_sysdig_monitor_alert_event_test.go | 5 ++ ...urce_sysdig_monitor_alert_group_outlier.go | 3 + ...sysdig_monitor_alert_group_outlier_test.go | 5 ++ .../resource_sysdig_monitor_alert_metric.go | 3 + ...source_sysdig_monitor_alert_metric_test.go | 5 ++ sysdig/resource_sysdig_monitor_dashboard.go | 3 + .../resource_sysdig_monitor_dashboard_test.go | 5 ++ ...sdig_monitor_notification_channel_email.go | 3 + ...monitor_notification_channel_email_test.go | 5 ++ ...g_monitor_notification_channel_opsgenie.go | 3 + ...itor_notification_channel_opsgenie_test.go | 5 ++ ..._monitor_notification_channel_pagerduty.go | 3 + ...tor_notification_channel_pagerduty_test.go | 5 ++ ...sdig_monitor_notification_channel_slack.go | 3 + ...monitor_notification_channel_slack_test.go | 5 ++ ...sysdig_monitor_notification_channel_sns.go | 3 + ...g_monitor_notification_channel_sns_test.go | 5 ++ ..._monitor_notification_channel_victorops.go | 3 + ...tor_notification_channel_victorops_test.go | 5 ++ ...ig_monitor_notification_channel_webhook.go | 3 + ...nitor_notification_channel_webhook_test.go | 5 ++ sysdig/resource_sysdig_monitor_team.go | 3 + sysdig/resource_sysdig_monitor_team_test.go | 5 ++ sysdig/resource_sysdig_secure_list.go | 3 + sysdig/resource_sysdig_secure_list_test.go | 5 ++ sysdig/resource_sysdig_secure_macro.go | 3 + sysdig/resource_sysdig_secure_macro_test.go | 5 ++ ...ysdig_secure_notification_channel_email.go | 3 + ..._secure_notification_channel_email_test.go | 5 ++ ...ig_secure_notification_channel_opsgenie.go | 3 + ...cure_notification_channel_opsgenie_test.go | 5 ++ ...g_secure_notification_channel_pagerduty.go | 3 + ...ure_notification_channel_pagerduty_test.go | 5 ++ ...ysdig_secure_notification_channel_slack.go | 3 + ..._secure_notification_channel_slack_test.go | 5 ++ ..._sysdig_secure_notification_channel_sns.go | 3 + ...ig_secure_notification_channel_sns_test.go | 5 ++ ...g_secure_notification_channel_victorops.go | 3 + ...ure_notification_channel_victorops_test.go | 5 ++ ...dig_secure_notification_channel_webhook.go | 3 + ...ecure_notification_channel_webhook_test.go | 5 ++ sysdig/resource_sysdig_secure_policy.go | 3 + sysdig/resource_sysdig_secure_policy_test.go | 5 ++ .../resource_sysdig_secure_rule_container.go | 3 + ...ource_sysdig_secure_rule_container_test.go | 5 ++ sysdig/resource_sysdig_secure_rule_falco.go | 3 + .../resource_sysdig_secure_rule_falco_test.go | 15 ++++ .../resource_sysdig_secure_rule_filesystem.go | 3 + ...urce_sysdig_secure_rule_filesystem_test.go | 5 ++ sysdig/resource_sysdig_secure_rule_network.go | 3 + ...esource_sysdig_secure_rule_network_test.go | 5 ++ sysdig/resource_sysdig_secure_rule_process.go | 3 + ...esource_sysdig_secure_rule_process_test.go | 5 ++ sysdig/resource_sysdig_secure_rule_syscall.go | 3 + ...esource_sysdig_secure_rule_syscall_test.go | 5 ++ sysdig/resource_sysdig_secure_team.go | 3 + sysdig/resource_sysdig_secure_team_test.go | 5 ++ sysdig/resource_sysdig_user.go | 3 + sysdig/resource_sysdig_user_test.go | 5 ++ .../docs/r/sysdig_monitor_alert_anomaly.md | 8 ++ .../docs/r/sysdig_monitor_alert_downtime.md | 11 ++- website/docs/r/sysdig_monitor_alert_event.md | 11 ++- .../r/sysdig_monitor_alert_group_outlier.md | 11 ++- website/docs/r/sysdig_monitor_alert_metric.md | 11 ++- website/docs/r/sysdig_monitor_dashboard.md | 8 ++ ...sdig_monitor_notification_channel_email.md | 8 ++ ...g_monitor_notification_channel_opsgenie.md | 8 ++ ..._monitor_notification_channel_pagerduty.md | 8 ++ ...sdig_monitor_notification_channel_slack.md | 8 ++ ...sysdig_monitor_notification_channel_sns.md | 8 ++ ..._monitor_notification_channel_victorops.md | 8 ++ ...ig_monitor_notification_channel_webhook.md | 8 ++ website/docs/r/sysdig_monitor_team.md | 8 ++ website/docs/r/sysdig_secure_list.md | 8 ++ website/docs/r/sysdig_secure_macro.md | 8 ++ ...ysdig_secure_notification_channel_email.md | 8 ++ ...ig_secure_notification_channel_opsgenie.md | 8 ++ ...g_secure_notification_channel_pagerduty.md | 8 ++ ...ysdig_secure_notification_channel_slack.md | 8 ++ .../sysdig_secure_notification_channel_sns.md | 8 ++ ...g_secure_notification_channel_victorops.md | 8 ++ ...dig_secure_notification_channel_webhook.md | 8 ++ website/docs/r/sysdig_secure_policy.md | 8 ++ .../docs/r/sysdig_secure_rule_container.md | 10 ++- website/docs/r/sysdig_secure_rule_falco.md | 10 ++- .../docs/r/sysdig_secure_rule_filesystem.md | 10 ++- website/docs/r/sysdig_secure_rule_network.md | 10 ++- website/docs/r/sysdig_secure_rule_process.md | 10 ++- website/docs/r/sysdig_secure_rule_syscall.md | 10 ++- website/docs/r/sysdig_secure_team.md | 10 ++- website/docs/r/sysdig_user.md | 11 ++- 104 files changed, 552 insertions(+), 255 deletions(-) delete mode 100644 examples/alert.tf delete mode 100644 examples/notification.tf delete mode 100644 examples/policy.tf delete mode 100644 examples/rules.tf delete mode 100644 examples/team.tf delete mode 100644 examples/user.tf diff --git a/examples/alert.tf b/examples/alert.tf deleted file mode 100644 index edbc1e06..00000000 --- a/examples/alert.tf +++ /dev/null @@ -1,76 +0,0 @@ - -resource "sysdig_monitor_alert_anomaly" "sample" { - name = "[Kubernetes] Anomaly Detection Alert" - description = "Detects an anomaly in the cluster" - severity = 6 - - monitor = ["cpu.used.percent", "memory.bytes.used"] - - trigger_after_minutes = 10 - - multiple_alerts_by = ["kubernetes.cluster.name", - "kubernetes.namespace.name", - "kubernetes.deployment.name", - "kubernetes.pod.name"] -} - -resource "sysdig_monitor_alert_downtime" "sample" { - name = "[Kubernetes] Downtime Alert" - description = "Detects a downtime in the Kubernetes cluster" - severity = 2 - - entities_to_monitor = ["kubernetes.namespace.name"] - - trigger_after_minutes = 10 - trigger_after_pct = 100 -} - -resource "sysdig_monitor_alert_event" "sample" { - name = "[Kubernetes] Failed to pull image" - description = "A Kubernetes pod failed to pull an image from the registry" - severity = 4 - - event_name = "Failed to pull image" - source = "kubernetes" - event_rel = ">" - event_count = 0 - - multiple_alerts_by = ["kubernetes.pod.name"] - - trigger_after_minutes = 1 -} - -resource "sysdig_monitor_alert_group_outlier" "sample" { - name = "[Kubernetes] A node is using more CPU than the rest" - description = "Monitors the cluster and checks when a node has more CPU usage than the others" - severity = 6 - - monitor = ["cpu.used.percent"] - - trigger_after_minutes = 10 - - capture { - filename = "TERRAFORM_TEST.scap" - duration = 15 - } -} - -resource "sysdig_monitor_alert_metric" "sample" { - name = "[Kubernetes] CrashLoopBackOff" - description = "A Kubernetes pod failed to restart" - severity = 6 - - metric = "sum(timeAvg(kubernetes.pod.restart.count)) > 2" - trigger_after_minutes = 1 - - multiple_alerts_by = ["kubernetes.cluster.name", - "kubernetes.namespace.name", - "kubernetes.deployment.name", - "kubernetes.pod.name"] - - capture { - filename = "CrashLoopBackOff.scap" - duration = 15 - } -} - diff --git a/examples/notification.tf b/examples/notification.tf deleted file mode 100644 index 5247ddf0..00000000 --- a/examples/notification.tf +++ /dev/null @@ -1,50 +0,0 @@ - -resource "sysdig_secure_notification_channel_email" "sample-email" { - name = "Example Channel - Email" - enabled = true - recipients = ["root@localhost.com"] - notify_when_ok = false - notify_when_resolved = false -} - -resource "sysdig_secure_notification_channel_sns" "sample-amazon-sns" { - name = "Example Channel - Amazon SNS" - enabled = true - topics = ["arn:aws:sns:us-east-1:273107874544:my-alerts", "arn:aws:sns:us-east-1:273107874544:my-alerts2"] - notify_when_ok = false - notify_when_resolved = false -} - -resource "sysdig_secure_notification_channel_victorops" "sample-victorops" { - name = "Example Channel - VictorOps" - enabled = true - api_key = "1234342-4234243-4234-2" - routing_key = "My team" - notify_when_ok = false - notify_when_resolved = false -} - -resource "sysdig_secure_notification_channel_opsgenie" "sample-opsgenie" { - name = "Example Channel - OpsGenie" - enabled = true - api_key = "2349324-342354353-5324-23" - notify_when_ok = false - notify_when_resolved = false -} - -resource "sysdig_secure_notification_channel_webhook" "sample-webhook" { - name = "Example Channel - Webhook" - enabled = true - url = "localhost:8080" - notify_when_ok = false - notify_when_resolved = false -} - -resource "sysdig_secure_notification_channel_slack" "sample-slack" { - name = "Example Channel - Slack" - enabled = true - url = "https://hooks.slack.cwom/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX" - channel = "#sysdig" - notify_when_ok = true - notify_when_resolved = true -} diff --git a/examples/policy.tf b/examples/policy.tf deleted file mode 100644 index 842760e4..00000000 --- a/examples/policy.tf +++ /dev/null @@ -1,19 +0,0 @@ - -resource "sysdig_secure_policy" "sample" { - name = "Other example of Policy" - description = "this is other example of policy" - enabled = true - severity = 4 - scope = "container.id != \"\"" - rule_names = ["Terminal shell in container"] - - actions { - container = "stop" - capture { - seconds_before_event = 5 - seconds_after_event = 10 - } - } - - notification_channels = [10000] -} \ No newline at end of file diff --git a/examples/rules.tf b/examples/rules.tf deleted file mode 100644 index d4f91264..00000000 --- a/examples/rules.tf +++ /dev/null @@ -1,70 +0,0 @@ -resource "sysdig_secure_rule_container" "sample" { - name = "Other example of Policy" - description = "this is other example of policy" - tags = ["container", "cis"] - - matching = true // default - containers = ["foo", "foo:bar"] -} - -resource "sysdig_secure_rule_filesystem" "foo" { - name = "Other example of Policy" - description = "this is other example of policy" - tags = ["filesystem", "cis"] - - read_only { - matching = true // default - paths = ["/etc"] - } - - read_write { - matching = true // default - paths = ["/tmp"] - } -} - -resource "sysdig_secure_rule_network" "foo" { - name = "Other example of Policy" // ID - description = "this is other example of policy" - tags = ["network", "cis"] - - block_inbound = true - block_outbound = true - - tcp { - matching = true // default - ports = [80, 443] - } - - udp { - matching = true // default - ports = [80, 443] - } -} - -resource "sysdig_secure_rule_process" "foo" { - name = "Other example of Policy" // ID - description = "this is other example of policy" - - matching = true // default - processes = ["bash"] -} - -resource "sysdig_secure_rule_syscall" "foo" { - name = "Other example of Policy" // ID - description = "this is other example of policy" - - matching = true // default - syscalls = ["open", "execve"] -} - -resource "sysdig_secure_rule_falco" "foo" { - name = "Other example of Policy" // ID - description = "this is other example of policy" - tags = ["container", "shell", "mitre_execution"] - - condition = "spawned_process and container and shell_procs and proc.tty != 0 and container_entrypoint" - output = "A shell was spawned in a container with an attached terminal (user=%user.name %container.info shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline terminal=%proc.tty container_id=%container.id image=%container.image.repository)" - priority = "notice" - source = "syscall" // syscall or k8s_audit -} diff --git a/examples/team.tf b/examples/team.tf deleted file mode 100644 index 8027765b..00000000 --- a/examples/team.tf +++ /dev/null @@ -1,19 +0,0 @@ -resource "sysdig_secure_team" "sample" { - name = "sample-team" - description = "sample" - scope_by = "container" - filter = "container.image.repo = \"sysdig/agent\"" - use_sysdig_capture = false - - user_roles { - email = "sample@example.com" - role = "ROLE_TEAM_STANDARD" - } - - user_roles { - email = "sample2@example.com" - role = "ROLE_TEAM_EDIT" - } - -} - diff --git a/examples/user.tf b/examples/user.tf deleted file mode 100644 index 99cbfa11..00000000 --- a/examples/user.tf +++ /dev/null @@ -1,6 +0,0 @@ -resource "sysdig_user" "sample" { - email = "sample@example.com" - system_role = "ROLE_CUSTOMER" - first_name = "John" - last_name = "Smith" -} diff --git a/go.mod b/go.mod index 76cfe6b5..f7176fd2 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.0 // indirect github.com/hashicorp/go-retryablehttp v0.6.8 github.com/hashicorp/go-uuid v1.0.2 // indirect - github.com/hashicorp/hcl/v2 v2.8.1 // indirect + github.com/hashicorp/hcl/v2 v2.8.2 // indirect github.com/hashicorp/terraform-plugin-go v0.2.0 // indirect github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.0 github.com/hashicorp/terraform-plugin-test/v2 v2.1.2 // indirect @@ -24,9 +24,9 @@ require ( github.com/spf13/cast v1.3.1 github.com/zclconf/go-cty v1.7.1 // indirect golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect - golang.org/x/sys v0.0.0-20201231184435-2d18734c6014 // indirect + golang.org/x/sys v0.0.0-20210105210732-16f7687f5001 // indirect golang.org/x/text v0.3.4 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d // indirect + google.golang.org/genproto v0.0.0-20210106152847-07624b53cd92 // indirect google.golang.org/grpc v1.34.0 // indirect ) diff --git a/go.sum b/go.sum index 15a6c0bb..2f698906 100644 --- a/go.sum +++ b/go.sum @@ -187,6 +187,7 @@ github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/f github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 h1:l1KB3bHVdvegcIf5upQ5mjcHjs2qsWnKh4Yr9xgIuu8= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= +github.com/hashicorp/go-getter v1.5.0 h1:ciWJaeZWSMbc5OiLMpKp40MKFPqO44i0h3uyfXPBkkk= github.com/hashicorp/go-getter v1.5.0/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= @@ -223,13 +224,17 @@ github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggU github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hcl/v2 v2.8.1 h1:FJ60CIYaMyJOKzPndhMyjiz353Fd+2jr6PodF5Xzb08= github.com/hashicorp/hcl/v2 v2.8.1/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= +github.com/hashicorp/hcl/v2 v2.8.2 h1:wmFle3D1vu0okesm8BTLVDyJ6/OL9DCLUwn0b2OptiY= +github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.10.0 h1:3nh/1e3u9gYRUQGOKWp/8wPR7ABlL2F14sZMZBrp+dM= github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= +github.com/hashicorp/terraform-exec v0.12.0 h1:Tb1VC2gqArl9EJziJjoazep2MyxMk00tnNKV/rgMba0= github.com/hashicorp/terraform-exec v0.12.0/go.mod h1:SGhto91bVRlgXQWcJ5znSz+29UZIa8kpBbkGwQ+g9E8= github.com/hashicorp/terraform-json v0.5.0 h1:7TV3/F3y7QVSuN4r9BEXqnWqrAyeOtON8f0wvREtyzs= github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= +github.com/hashicorp/terraform-json v0.8.0 h1:XObQ3PgqU52YLQKEaJ08QtUshAfN3yu4u8ebSW0vztc= github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= github.com/hashicorp/terraform-plugin-go v0.1.0 h1:kyXZ0nkHxiRev/q18N40IbRRk4AV0zE/MDJkDM3u8dY= github.com/hashicorp/terraform-plugin-go v0.1.0/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= @@ -350,6 +355,7 @@ github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.7 h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4= github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible h1:wapg9xDUZDzGCNFlwc5SqI1rvcciqcxEHac4CYj89xI= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -501,6 +507,8 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201231184435-2d18734c6014 h1:joucsQqXmyBVxViHCPFjG3hx8JzIFSaym3l3MM/Jsdg= golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210105210732-16f7687f5001 h1:/dSxr6gT0FNI1MO5WLJo8mTmItROeOKTkDn+7OwWBos= +golang.org/x/sys v0.0.0-20210105210732-16f7687f5001/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -618,6 +626,8 @@ google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxt google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d h1:HV9Z9qMhQEsdlvxNFELgQ11RkMzO3CMkjEySjCtuLes= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210106152847-07624b53cd92 h1:jOTk2Z6KYaWoptUFqZ167cS8peoUPjFEXrsqfVkkCGc= +google.golang.org/genproto v0.0.0-20210106152847-07624b53cd92/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= diff --git a/sysdig/resource_sysdig_monitor_alert_anomaly.go b/sysdig/resource_sysdig_monitor_alert_anomaly.go index 9bc04f0a..9b3eed51 100644 --- a/sysdig/resource_sysdig_monitor_alert_anomaly.go +++ b/sysdig/resource_sysdig_monitor_alert_anomaly.go @@ -17,6 +17,9 @@ func resourceSysdigMonitorAlertAnomaly() *schema.Resource { UpdateContext: resourceSysdigAlertAnomalyUpdate, ReadContext: resourceSysdigAlertAnomalyRead, DeleteContext: resourceSysdigAlertAnomalyDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_alert_anomaly_test.go b/sysdig/resource_sysdig_monitor_alert_anomaly_test.go index 8eb20175..ce2093ca 100644 --- a/sysdig/resource_sysdig_monitor_alert_anomaly_test.go +++ b/sysdig/resource_sysdig_monitor_alert_anomaly_test.go @@ -28,6 +28,11 @@ func TestAccAlertAnomaly(t *testing.T) { { Config: alertAnomalyWithName(rText()), }, + { + ResourceName: "sysdig_monitor_alert_anomaly.sample", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_alert_downtime.go b/sysdig/resource_sysdig_monitor_alert_downtime.go index 19c0b8fa..727c82a2 100644 --- a/sysdig/resource_sysdig_monitor_alert_downtime.go +++ b/sysdig/resource_sysdig_monitor_alert_downtime.go @@ -18,6 +18,9 @@ func resourceSysdigMonitorAlertDowntime() *schema.Resource { UpdateContext: resourceSysdigAlertDowntimeUpdate, ReadContext: resourceSysdigAlertDowntimeRead, DeleteContext: resourceSysdigAlertDowntimeDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_alert_downtime_test.go b/sysdig/resource_sysdig_monitor_alert_downtime_test.go index 983fdf17..ac1e303c 100644 --- a/sysdig/resource_sysdig_monitor_alert_downtime_test.go +++ b/sysdig/resource_sysdig_monitor_alert_downtime_test.go @@ -28,6 +28,11 @@ func TestAccAlertDowntime(t *testing.T) { { Config: alertDowntimeWithName(rText()), }, + { + ResourceName: "sysdig_monitor_alert_downtime.sample", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_alert_event.go b/sysdig/resource_sysdig_monitor_alert_event.go index dacee83c..69a5199e 100644 --- a/sysdig/resource_sysdig_monitor_alert_event.go +++ b/sysdig/resource_sysdig_monitor_alert_event.go @@ -18,6 +18,9 @@ func resourceSysdigMonitorAlertEvent() *schema.Resource { UpdateContext: resourceSysdigAlertEventUpdate, ReadContext: resourceSysdigAlertEventRead, DeleteContext: resourceSysdigAlertEventDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_alert_event_test.go b/sysdig/resource_sysdig_monitor_alert_event_test.go index 825b9eb7..e35a7fb9 100644 --- a/sysdig/resource_sysdig_monitor_alert_event_test.go +++ b/sysdig/resource_sysdig_monitor_alert_event_test.go @@ -28,6 +28,11 @@ func TestAccAlertEvent(t *testing.T) { { Config: alertEventWithName(rText()), }, + { + ResourceName: "sysdig_monitor_alert_event.sample", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_alert_group_outlier.go b/sysdig/resource_sysdig_monitor_alert_group_outlier.go index f392e10f..ba8f9f33 100644 --- a/sysdig/resource_sysdig_monitor_alert_group_outlier.go +++ b/sysdig/resource_sysdig_monitor_alert_group_outlier.go @@ -17,6 +17,9 @@ func resourceSysdigMonitorAlertGroupOutlier() *schema.Resource { UpdateContext: resourceSysdigAlertGroupOutlierUpdate, ReadContext: resourceSysdigAlertGroupOutlierRead, DeleteContext: resourceSysdigAlertGroupOutlierDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_alert_group_outlier_test.go b/sysdig/resource_sysdig_monitor_alert_group_outlier_test.go index b8e0001f..63c9fead 100644 --- a/sysdig/resource_sysdig_monitor_alert_group_outlier_test.go +++ b/sysdig/resource_sysdig_monitor_alert_group_outlier_test.go @@ -28,6 +28,11 @@ func TestAccAlertGroupOutlier(t *testing.T) { { Config: alertGroupOutlierWithName(rText()), }, + { + ResourceName: "sysdig_monitor_alert_group_outlier.sample", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_alert_metric.go b/sysdig/resource_sysdig_monitor_alert_metric.go index 55ad7e03..4e6b7c20 100644 --- a/sysdig/resource_sysdig_monitor_alert_metric.go +++ b/sysdig/resource_sysdig_monitor_alert_metric.go @@ -17,6 +17,9 @@ func resourceSysdigMonitorAlertMetric() *schema.Resource { UpdateContext: resourceSysdigAlertMetricUpdate, ReadContext: resourceSysdigAlertMetricRead, DeleteContext: resourceSysdigAlertMetricDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_alert_metric_test.go b/sysdig/resource_sysdig_monitor_alert_metric_test.go index 73944ce9..0675e7ba 100644 --- a/sysdig/resource_sysdig_monitor_alert_metric_test.go +++ b/sysdig/resource_sysdig_monitor_alert_metric_test.go @@ -34,6 +34,11 @@ func TestAccAlertMetric(t *testing.T) { { Config: alertMetricWithNotificationChannel(rText()), }, + { + ResourceName: "sysdig_secure_notification_channel_pagerduty.sample-pagerduty", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_dashboard.go b/sysdig/resource_sysdig_monitor_dashboard.go index 1e22d765..4a7aa521 100644 --- a/sysdig/resource_sysdig_monitor_dashboard.go +++ b/sysdig/resource_sysdig_monitor_dashboard.go @@ -18,6 +18,9 @@ func resourceSysdigMonitorDashboard() *schema.Resource { UpdateContext: resourceSysdigDashboardUpdate, ReadContext: resourceSysdigDashboardRead, DeleteContext: resourceSysdigDashboardDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_dashboard_test.go b/sysdig/resource_sysdig_monitor_dashboard_test.go index e431180c..15900266 100644 --- a/sysdig/resource_sysdig_monitor_dashboard_test.go +++ b/sysdig/resource_sysdig_monitor_dashboard_test.go @@ -34,6 +34,11 @@ func TestAccDashboard(t *testing.T) { { Config: multiplePanelsDashboard(rText()), }, + { + ResourceName: "sysdig_monitor_dashboard.dashboard", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_notification_channel_email.go b/sysdig/resource_sysdig_monitor_notification_channel_email.go index 03487a1c..fd627af6 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_email.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_email.go @@ -20,6 +20,9 @@ func resourceSysdigMonitorNotificationChannelEmail() *schema.Resource { UpdateContext: resourceSysdigMonitorNotificationChannelEmailUpdate, ReadContext: resourceSysdigMonitorNotificationChannelEmailRead, DeleteContext: resourceSysdigMonitorNotificationChannelEmailDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_notification_channel_email_test.go b/sysdig/resource_sysdig_monitor_notification_channel_email_test.go index 2b4d9045..734cab6c 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_email_test.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_email_test.go @@ -33,6 +33,11 @@ func TestAccMonitorNotificationChannelEmail(t *testing.T) { { Config: monitorNotificationChannelEmailWithNameInReverseOrder(rText()), }, + { + ResourceName: "sysdig_monitor_notification_channel_email.sample_email", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_notification_channel_opsgenie.go b/sysdig/resource_sysdig_monitor_notification_channel_opsgenie.go index 7415f15d..02f50a96 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_opsgenie.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_opsgenie.go @@ -21,6 +21,9 @@ func resourceSysdigMonitorNotificationChannelOpsGenie() *schema.Resource { UpdateContext: resourceSysdigMonitorNotificationChannelOpsGenieUpdate, ReadContext: resourceSysdigMonitorNotificationChannelOpsGenieRead, DeleteContext: resourceSysdigMonitorNotificationChannelOpsGenieDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_notification_channel_opsgenie_test.go b/sysdig/resource_sysdig_monitor_notification_channel_opsgenie_test.go index f66389d2..e79cde19 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_opsgenie_test.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_opsgenie_test.go @@ -31,6 +31,11 @@ func TestAccMonitorNotificationChannelOpsGenie(t *testing.T) { { Config: monitorNotificationChannelOpsGenieWithName(rText()), }, + { + ResourceName: "sysdig_monitor_notification_channel_opsgenie.sample-opsgenie", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_notification_channel_pagerduty.go b/sysdig/resource_sysdig_monitor_notification_channel_pagerduty.go index ad57c861..21b517ee 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_pagerduty.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_pagerduty.go @@ -19,6 +19,9 @@ func resourceSysdigMonitorNotificationChannelPagerduty() *schema.Resource { UpdateContext: resourceSysdigMonitorNotificationChannelPagerdutyUpdate, ReadContext: resourceSysdigMonitorNotificationChannelPagerdutyRead, DeleteContext: resourceSysdigMonitorNotificationChannelPagerdutyDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_notification_channel_pagerduty_test.go b/sysdig/resource_sysdig_monitor_notification_channel_pagerduty_test.go index 0ae8c24b..e9d440dd 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_pagerduty_test.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_pagerduty_test.go @@ -29,6 +29,11 @@ func TestAccMonitorNotificationChannelPagerduty(t *testing.T) { { Config: monitorNotificationChannelPagerdutyWithName(rText()), }, + { + ResourceName: "sysdig_monitor_notification_channel_pagerduty.sample-pagerduty", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_notification_channel_slack.go b/sysdig/resource_sysdig_monitor_notification_channel_slack.go index 9209b980..c153879e 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_slack.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_slack.go @@ -19,6 +19,9 @@ func resourceSysdigMonitorNotificationChannelSlack() *schema.Resource { UpdateContext: resourceSysdigMonitorNotificationChannelSlackUpdate, ReadContext: resourceSysdigMonitorNotificationChannelSlackRead, DeleteContext: resourceSysdigMonitorNotificationChannelSlackDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_notification_channel_slack_test.go b/sysdig/resource_sysdig_monitor_notification_channel_slack_test.go index 7e3f2ec4..efa51532 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_slack_test.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_slack_test.go @@ -29,6 +29,11 @@ func TestAccMonitorNotificationChannelSlack(t *testing.T) { { Config: monitorNotificationChannelSlackWithName(rText()), }, + { + ResourceName: "sysdig_monitor_notification_channel_slack.sample-slack", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_notification_channel_sns.go b/sysdig/resource_sysdig_monitor_notification_channel_sns.go index 9ab32ebf..92fb7c56 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_sns.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_sns.go @@ -20,6 +20,9 @@ func resourceSysdigMonitorNotificationChannelSNS() *schema.Resource { UpdateContext: resourceSysdigMonitorNotificationChannelSNSUpdate, ReadContext: resourceSysdigMonitorNotificationChannelSNSRead, DeleteContext: resourceSysdigMonitorNotificationChannelSNSDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_notification_channel_sns_test.go b/sysdig/resource_sysdig_monitor_notification_channel_sns_test.go index 1a220257..0e52df53 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_sns_test.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_sns_test.go @@ -31,6 +31,11 @@ func TestAccMonitorNotificationChannelSNS(t *testing.T) { { Config: monitorNotificationChannelAmazonSNSWithName(rText()), }, + { + ResourceName: "sysdig_monitor_notification_channel_sns.sample-amazon-sns", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_notification_channel_victorops.go b/sysdig/resource_sysdig_monitor_notification_channel_victorops.go index 6b964b13..f27ae18d 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_victorops.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_victorops.go @@ -19,6 +19,9 @@ func resourceSysdigMonitorNotificationChannelVictorOps() *schema.Resource { UpdateContext: resourceSysdigMonitorNotificationChannelVictorOpsUpdate, ReadContext: resourceSysdigMonitorNotificationChannelVictorOpsRead, DeleteContext: resourceSysdigMonitorNotificationChannelVictorOpsDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_notification_channel_victorops_test.go b/sysdig/resource_sysdig_monitor_notification_channel_victorops_test.go index 2ada3e41..1c95f743 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_victorops_test.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_victorops_test.go @@ -31,6 +31,11 @@ func TestAccMonitorNotificationChannelVictorOps(t *testing.T) { { Config: monitorNotificationChannelVictorOpsWithName(rText()), }, + { + ResourceName: "sysdig_monitor_notification_channel_victorops.sample-victorops", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_notification_channel_webhook.go b/sysdig/resource_sysdig_monitor_notification_channel_webhook.go index 726c9ca8..b6e0a003 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_webhook.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_webhook.go @@ -19,6 +19,9 @@ func resourceSysdigMonitorNotificationChannelWebhook() *schema.Resource { UpdateContext: resourceSysdigMonitorNotificationChannelWebhookUpdate, ReadContext: resourceSysdigMonitorNotificationChannelWebhookRead, DeleteContext: resourceSysdigMonitorNotificationChannelWebhookDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_notification_channel_webhook_test.go b/sysdig/resource_sysdig_monitor_notification_channel_webhook_test.go index 4a534cb6..c7111736 100644 --- a/sysdig/resource_sysdig_monitor_notification_channel_webhook_test.go +++ b/sysdig/resource_sysdig_monitor_notification_channel_webhook_test.go @@ -29,6 +29,11 @@ func TestAccMonitorNotificationChannelWebhook(t *testing.T) { { Config: monitorNotificationChannelWebhookWithName(rText()), }, + { + ResourceName: "sysdig_monitor_notification_channel_webhook.sample-webhook", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_monitor_team.go b/sysdig/resource_sysdig_monitor_team.go index 56c82d6f..946c9d5a 100644 --- a/sysdig/resource_sysdig_monitor_team.go +++ b/sysdig/resource_sysdig_monitor_team.go @@ -18,6 +18,9 @@ func resourceSysdigMonitorTeam() *schema.Resource { UpdateContext: resourceSysdigMonitorTeamUpdate, ReadContext: resourceSysdigMonitorTeamRead, DeleteContext: resourceSysdigMonitorTeamDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_monitor_team_test.go b/sysdig/resource_sysdig_monitor_team_test.go index 1d417022..57b14258 100644 --- a/sysdig/resource_sysdig_monitor_team_test.go +++ b/sysdig/resource_sysdig_monitor_team_test.go @@ -34,6 +34,11 @@ func TestAccMonitorTeam(t *testing.T) { { Config: monitorTeamWithFullConfig(rText()), }, + { + ResourceName: "sysdig_monitor_team.sample", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_secure_list.go b/sysdig/resource_sysdig_secure_list.go index 8e4188a4..84281f25 100644 --- a/sysdig/resource_sysdig_secure_list.go +++ b/sysdig/resource_sysdig_secure_list.go @@ -18,6 +18,9 @@ func resourceSysdigSecureList() *schema.Resource { UpdateContext: resourceSysdigListUpdate, ReadContext: resourceSysdigListRead, DeleteContext: resourceSysdigListDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_list_test.go b/sysdig/resource_sysdig_secure_list_test.go index c59431c4..0e4e4ca8 100644 --- a/sysdig/resource_sysdig_secure_list_test.go +++ b/sysdig/resource_sysdig_secure_list_test.go @@ -35,6 +35,11 @@ func TestAccList(t *testing.T) { { Config: listUpdatedWithName(fixedRandomText), }, + { + ResourceName: "sysdig_secure_list.sample", + ImportState: true, + ImportStateVerify: true, + }, { Config: listAppendToDefault(), }, diff --git a/sysdig/resource_sysdig_secure_macro.go b/sysdig/resource_sysdig_secure_macro.go index 7cbfe84a..f80b57a0 100644 --- a/sysdig/resource_sysdig_secure_macro.go +++ b/sysdig/resource_sysdig_secure_macro.go @@ -17,6 +17,9 @@ func resourceSysdigSecureMacro() *schema.Resource { UpdateContext: resourceSysdigMacroUpdate, ReadContext: resourceSysdigMacroRead, DeleteContext: resourceSysdigMacroDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_macro_test.go b/sysdig/resource_sysdig_secure_macro_test.go index a8f5f14d..26abbbe0 100644 --- a/sysdig/resource_sysdig_secure_macro_test.go +++ b/sysdig/resource_sysdig_secure_macro_test.go @@ -35,6 +35,11 @@ func TestAccMacro(t *testing.T) { { Config: macroUpdatedWithName(fixedRandomText), }, + { + ResourceName: "sysdig_secure_macro.sample", + ImportState: true, + ImportStateVerify: true, + }, { Config: macroAppendToDefault(), }, diff --git a/sysdig/resource_sysdig_secure_notification_channel_email.go b/sysdig/resource_sysdig_secure_notification_channel_email.go index 61187361..f4b5472c 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_email.go +++ b/sysdig/resource_sysdig_secure_notification_channel_email.go @@ -20,6 +20,9 @@ func resourceSysdigSecureNotificationChannelEmail() *schema.Resource { UpdateContext: resourceSysdigSecureNotificationChannelEmailUpdate, ReadContext: resourceSysdigSecureNotificationChannelEmailRead, DeleteContext: resourceSysdigSecureNotificationChannelEmailDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_notification_channel_email_test.go b/sysdig/resource_sysdig_secure_notification_channel_email_test.go index 0c72c669..bc0263fa 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_email_test.go +++ b/sysdig/resource_sysdig_secure_notification_channel_email_test.go @@ -31,6 +31,11 @@ func TestAccSecureNotificationChannelEmail(t *testing.T) { { Config: secureNotificationChannelEmailWithName(rText()), }, + { + ResourceName: "sysdig_secure_notification_channel_email.sample_email", + ImportState: true, + ImportStateVerify: true, + }, { Config: secureNotificationChannelEmailWithNameInReverseOrder(rText()), }, diff --git a/sysdig/resource_sysdig_secure_notification_channel_opsgenie.go b/sysdig/resource_sysdig_secure_notification_channel_opsgenie.go index ce200ad7..2a7b0594 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_opsgenie.go +++ b/sysdig/resource_sysdig_secure_notification_channel_opsgenie.go @@ -21,6 +21,9 @@ func resourceSysdigSecureNotificationChannelOpsGenie() *schema.Resource { UpdateContext: resourceSysdigSecureNotificationChannelOpsGenieUpdate, ReadContext: resourceSysdigSecureNotificationChannelOpsGenieRead, DeleteContext: resourceSysdigSecureNotificationChannelOpsGenieDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_notification_channel_opsgenie_test.go b/sysdig/resource_sysdig_secure_notification_channel_opsgenie_test.go index e28a7d06..6837722e 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_opsgenie_test.go +++ b/sysdig/resource_sysdig_secure_notification_channel_opsgenie_test.go @@ -31,6 +31,11 @@ func TestAccSecureNotificationChannelOpsGenie(t *testing.T) { { Config: secureNotificationChannelOpsGenieWithName(rText()), }, + { + ResourceName: "sysdig_secure_notification_channel_opsgenie.sample-opsgenie", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_secure_notification_channel_pagerduty.go b/sysdig/resource_sysdig_secure_notification_channel_pagerduty.go index b1c73b39..30e79f10 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_pagerduty.go +++ b/sysdig/resource_sysdig_secure_notification_channel_pagerduty.go @@ -19,6 +19,9 @@ func resourceSysdigSecureNotificationChannelPagerduty() *schema.Resource { UpdateContext: resourceSysdigSecureNotificationChannelPagerdutyUpdate, ReadContext: resourceSysdigSecureNotificationChannelPagerdutyRead, DeleteContext: resourceSysdigSecureNotificationChannelPagerdutyDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_notification_channel_pagerduty_test.go b/sysdig/resource_sysdig_secure_notification_channel_pagerduty_test.go index e8b4ed84..a3d47c54 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_pagerduty_test.go +++ b/sysdig/resource_sysdig_secure_notification_channel_pagerduty_test.go @@ -29,6 +29,11 @@ func TestAccSecureNotificationChannelPagerduty(t *testing.T) { { Config: secureNotificationChannelPagerdutyWithName(rText()), }, + { + ResourceName: "sysdig_secure_notification_channel_pagerduty.sample-pagerduty", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_secure_notification_channel_slack.go b/sysdig/resource_sysdig_secure_notification_channel_slack.go index 5d0e41dc..b4d410e0 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_slack.go +++ b/sysdig/resource_sysdig_secure_notification_channel_slack.go @@ -19,6 +19,9 @@ func resourceSysdigSecureNotificationChannelSlack() *schema.Resource { UpdateContext: resourceSysdigSecureNotificationChannelSlackUpdate, ReadContext: resourceSysdigSecureNotificationChannelSlackRead, DeleteContext: resourceSysdigSecureNotificationChannelSlackDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_notification_channel_slack_test.go b/sysdig/resource_sysdig_secure_notification_channel_slack_test.go index 91fbb707..006eeaf9 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_slack_test.go +++ b/sysdig/resource_sysdig_secure_notification_channel_slack_test.go @@ -29,6 +29,11 @@ func TestAccSecureNotificationChannelSlack(t *testing.T) { { Config: secureNotificationChannelSlackWithName(rText()), }, + { + ResourceName: "sysdig_secure_notification_channel_slack.sample-slack", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_secure_notification_channel_sns.go b/sysdig/resource_sysdig_secure_notification_channel_sns.go index 7e05e59a..a10c9a37 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_sns.go +++ b/sysdig/resource_sysdig_secure_notification_channel_sns.go @@ -20,6 +20,9 @@ func resourceSysdigSecureNotificationChannelSNS() *schema.Resource { UpdateContext: resourceSysdigSecureNotificationChannelSNSUpdate, ReadContext: resourceSysdigSecureNotificationChannelSNSRead, DeleteContext: resourceSysdigSecureNotificationChannelSNSDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_notification_channel_sns_test.go b/sysdig/resource_sysdig_secure_notification_channel_sns_test.go index e931e2c2..3b50e5c6 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_sns_test.go +++ b/sysdig/resource_sysdig_secure_notification_channel_sns_test.go @@ -31,6 +31,11 @@ func TestAccSecureNotificationChannelSNS(t *testing.T) { { Config: secureNotificationChannelAmazonSNSWithName(rText()), }, + { + ResourceName: "sysdig_secure_notification_channel_sns.sample-amazon-sns", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_secure_notification_channel_victorops.go b/sysdig/resource_sysdig_secure_notification_channel_victorops.go index f27a80ce..a30cebe0 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_victorops.go +++ b/sysdig/resource_sysdig_secure_notification_channel_victorops.go @@ -19,6 +19,9 @@ func resourceSysdigSecureNotificationChannelVictorOps() *schema.Resource { UpdateContext: resourceSysdigSecureNotificationChannelVictorOpsUpdate, ReadContext: resourceSysdigSecureNotificationChannelVictorOpsRead, DeleteContext: resourceSysdigSecureNotificationChannelVictorOpsDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_notification_channel_victorops_test.go b/sysdig/resource_sysdig_secure_notification_channel_victorops_test.go index 54640dd2..0a742b34 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_victorops_test.go +++ b/sysdig/resource_sysdig_secure_notification_channel_victorops_test.go @@ -31,6 +31,11 @@ func TestAccSecureNotificationChannelVictorOps(t *testing.T) { { Config: secureNotificationChannelVictorOpsWithName(rText()), }, + { + ResourceName: "sysdig_secure_notification_channel_victorops.sample-victorops", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_secure_notification_channel_webhook.go b/sysdig/resource_sysdig_secure_notification_channel_webhook.go index 999fbf1a..c69962ee 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_webhook.go +++ b/sysdig/resource_sysdig_secure_notification_channel_webhook.go @@ -19,6 +19,9 @@ func resourceSysdigSecureNotificationChannelWebhook() *schema.Resource { UpdateContext: resourceSysdigSecureNotificationChannelWebhookUpdate, ReadContext: resourceSysdigSecureNotificationChannelWebhookRead, DeleteContext: resourceSysdigSecureNotificationChannelWebhookDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_notification_channel_webhook_test.go b/sysdig/resource_sysdig_secure_notification_channel_webhook_test.go index a715ec85..8b85dd2d 100644 --- a/sysdig/resource_sysdig_secure_notification_channel_webhook_test.go +++ b/sysdig/resource_sysdig_secure_notification_channel_webhook_test.go @@ -29,6 +29,11 @@ func TestAccSecureNotificationChannelWebhook(t *testing.T) { { Config: secureNotificationChannelWebhookWithName(rText()), }, + { + ResourceName: "sysdig_secure_notification_channel_webhook.sample-webhook", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_secure_policy.go b/sysdig/resource_sysdig_secure_policy.go index 85eb7d10..797d54b2 100644 --- a/sysdig/resource_sysdig_secure_policy.go +++ b/sysdig/resource_sysdig_secure_policy.go @@ -33,6 +33,9 @@ func resourceSysdigSecurePolicy() *schema.Resource { ReadContext: resourceSysdigPolicyRead, UpdateContext: resourceSysdigPolicyUpdate, DeleteContext: resourceSysdigPolicyDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_policy_test.go b/sysdig/resource_sysdig_secure_policy_test.go index 30ff0139..5dac1ea5 100644 --- a/sysdig/resource_sysdig_secure_policy_test.go +++ b/sysdig/resource_sysdig_secure_policy_test.go @@ -28,6 +28,11 @@ func TestAccPolicy(t *testing.T) { { Config: policyWithName(rText()), }, + { + ResourceName: "sysdig_secure_policy.sample", + ImportState: true, + ImportStateVerify: true, + }, { Config: policyWithoutActions(rText()), }, diff --git a/sysdig/resource_sysdig_secure_rule_container.go b/sysdig/resource_sysdig_secure_rule_container.go index 7b8731c4..122dac76 100644 --- a/sysdig/resource_sysdig_secure_rule_container.go +++ b/sysdig/resource_sysdig_secure_rule_container.go @@ -19,6 +19,9 @@ func resourceSysdigSecureRuleContainer() *schema.Resource { UpdateContext: resourceSysdigRuleContainerUpdate, ReadContext: resourceSysdigRuleContainerRead, DeleteContext: resourceSysdigRuleContainerDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_rule_container_test.go b/sysdig/resource_sysdig_secure_rule_container_test.go index 5f0be588..54517b5b 100644 --- a/sysdig/resource_sysdig_secure_rule_container_test.go +++ b/sysdig/resource_sysdig_secure_rule_container_test.go @@ -28,6 +28,11 @@ func TestAccRuleContainer(t *testing.T) { { Config: ruleContainerWithName(rText()), }, + { + ResourceName: "sysdig_secure_rule_container.sample", + ImportState: true, + ImportStateVerify: true, + }, { Config: ruleContainerWithNameWithoutTags(rText()), }, diff --git a/sysdig/resource_sysdig_secure_rule_falco.go b/sysdig/resource_sysdig_secure_rule_falco.go index caf837a3..f7aadc62 100644 --- a/sysdig/resource_sysdig_secure_rule_falco.go +++ b/sysdig/resource_sysdig_secure_rule_falco.go @@ -22,6 +22,9 @@ func resourceSysdigSecureRuleFalco() *schema.Resource { UpdateContext: resourceSysdigRuleFalcoUpdate, ReadContext: resourceSysdigRuleFalcoRead, DeleteContext: resourceSysdigRuleFalcoDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_rule_falco_test.go b/sysdig/resource_sysdig_secure_rule_falco_test.go index 60d83830..a351b53c 100644 --- a/sysdig/resource_sysdig_secure_rule_falco_test.go +++ b/sysdig/resource_sysdig_secure_rule_falco_test.go @@ -36,12 +36,27 @@ func TestAccRuleFalco(t *testing.T) { { Config: ruleFalcoUpdatedTerminalShell(ruleRandomImmutableText), }, + { + ResourceName: "sysdig_secure_rule_falco.terminal_shell", + ImportState: true, + ImportStateVerify: true, + }, { Config: ruleFalcoTerminalShellWithAppend(), }, + { + ResourceName: "sysdig_secure_rule_falco.terminal_shell_append", + ImportState: true, + ImportStateVerify: true, + }, { Config: ruleFalcoKubeAudit(rText()), }, + { + ResourceName: "sysdig_secure_rule_falco.kube_audit", + ImportState: true, + ImportStateVerify: true, + }, // Incorrect configurations { Config: ruleFalcoTerminalShellWithMissingOuput(rText()), diff --git a/sysdig/resource_sysdig_secure_rule_filesystem.go b/sysdig/resource_sysdig_secure_rule_filesystem.go index e8ff62bb..a5516dd8 100644 --- a/sysdig/resource_sysdig_secure_rule_filesystem.go +++ b/sysdig/resource_sysdig_secure_rule_filesystem.go @@ -19,6 +19,9 @@ func resourceSysdigSecureRuleFilesystem() *schema.Resource { UpdateContext: resourceSysdigRuleFilesystemUpdate, ReadContext: resourceSysdigRuleFilesystemRead, DeleteContext: resourceSysdigRuleFilesystemDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_rule_filesystem_test.go b/sysdig/resource_sysdig_secure_rule_filesystem_test.go index 8e18ee7d..14e3eb6b 100644 --- a/sysdig/resource_sysdig_secure_rule_filesystem_test.go +++ b/sysdig/resource_sysdig_secure_rule_filesystem_test.go @@ -37,6 +37,11 @@ func TestAccRuleFilesystem(t *testing.T) { { Config: ruleFilesystemWithReadwriteWithName(rText()), }, + { + ResourceName: "sysdig_secure_rule_filesystem.foo", + ImportState: true, + ImportStateVerify: true, + }, { Config: ruleFilesystemMinimalConfig(rText()), }, diff --git a/sysdig/resource_sysdig_secure_rule_network.go b/sysdig/resource_sysdig_secure_rule_network.go index b10ad936..5cd67658 100644 --- a/sysdig/resource_sysdig_secure_rule_network.go +++ b/sysdig/resource_sysdig_secure_rule_network.go @@ -19,6 +19,9 @@ func resourceSysdigSecureRuleNetwork() *schema.Resource { UpdateContext: resourceSysdigRuleNetworkUpdate, ReadContext: resourceSysdigRuleNetworkRead, DeleteContext: resourceSysdigRuleNetworkDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_rule_network_test.go b/sysdig/resource_sysdig_secure_rule_network_test.go index 0ea2baa2..265c7ec4 100644 --- a/sysdig/resource_sysdig_secure_rule_network_test.go +++ b/sysdig/resource_sysdig_secure_rule_network_test.go @@ -37,6 +37,11 @@ func TestAccRuleNetwork(t *testing.T) { { Config: ruleNetworkWithUDP(rText()), }, + { + ResourceName: "sysdig_secure_rule_network.foo", + ImportState: true, + ImportStateVerify: true, + }, { Config: ruleNetworkWithMinimalConfig(rText()), }, diff --git a/sysdig/resource_sysdig_secure_rule_process.go b/sysdig/resource_sysdig_secure_rule_process.go index 59f073bf..5b91e0d8 100644 --- a/sysdig/resource_sysdig_secure_rule_process.go +++ b/sysdig/resource_sysdig_secure_rule_process.go @@ -19,6 +19,9 @@ func resourceSysdigSecureRuleProcess() *schema.Resource { UpdateContext: resourceSysdigRuleProcessUpdate, ReadContext: resourceSysdigRuleProcessRead, DeleteContext: resourceSysdigRuleProcessDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_rule_process_test.go b/sysdig/resource_sysdig_secure_rule_process_test.go index 6acf5b03..87e43e6b 100644 --- a/sysdig/resource_sysdig_secure_rule_process_test.go +++ b/sysdig/resource_sysdig_secure_rule_process_test.go @@ -31,6 +31,11 @@ func TestAccRuleProcess(t *testing.T) { { Config: ruleProcessWithoutTags(rText()), }, + { + ResourceName: "sysdig_secure_rule_process.foo", + ImportState: true, + ImportStateVerify: true, + }, { Config: ruleProcessWithMinimalConfig(rText()), }, diff --git a/sysdig/resource_sysdig_secure_rule_syscall.go b/sysdig/resource_sysdig_secure_rule_syscall.go index a0037539..904e4247 100644 --- a/sysdig/resource_sysdig_secure_rule_syscall.go +++ b/sysdig/resource_sysdig_secure_rule_syscall.go @@ -19,6 +19,9 @@ func resourceSysdigSecureRuleSyscall() *schema.Resource { UpdateContext: resourceSysdigRuleSyscallUpdate, ReadContext: resourceSysdigRuleSyscallRead, DeleteContext: resourceSysdigRuleSyscallDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_rule_syscall_test.go b/sysdig/resource_sysdig_secure_rule_syscall_test.go index eafb8b49..0ba11d43 100644 --- a/sysdig/resource_sysdig_secure_rule_syscall_test.go +++ b/sysdig/resource_sysdig_secure_rule_syscall_test.go @@ -28,6 +28,11 @@ func TestAccRuleSyscall(t *testing.T) { { Config: ruleSyscallWithName(rText()), }, + { + ResourceName: "sysdig_secure_rule_syscall.foo", + ImportState: true, + ImportStateVerify: true, + }, { Config: ruleSyscallWithoutTags(rText()), }, diff --git a/sysdig/resource_sysdig_secure_team.go b/sysdig/resource_sysdig_secure_team.go index 18da363d..da10262f 100644 --- a/sysdig/resource_sysdig_secure_team.go +++ b/sysdig/resource_sysdig_secure_team.go @@ -18,6 +18,9 @@ func resourceSysdigSecureTeam() *schema.Resource { UpdateContext: resourceSysdigSecureTeamUpdate, ReadContext: resourceSysdigSecureTeamRead, DeleteContext: resourceSysdigSecureTeamDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_secure_team_test.go b/sysdig/resource_sysdig_secure_team_test.go index 69752c37..6cd85b59 100644 --- a/sysdig/resource_sysdig_secure_team_test.go +++ b/sysdig/resource_sysdig_secure_team_test.go @@ -31,6 +31,11 @@ func TestAccSecureTeam(t *testing.T) { { Config: secureTeamMinimumConfiguration(rText()), }, + { + ResourceName: "sysdig_secure_team.sample", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/sysdig/resource_sysdig_user.go b/sysdig/resource_sysdig_user.go index b7c348c4..d5984c66 100644 --- a/sysdig/resource_sysdig_user.go +++ b/sysdig/resource_sysdig_user.go @@ -17,6 +17,9 @@ func resourceSysdigUser() *schema.Resource { UpdateContext: resourceSysdigUserUpdate, ReadContext: resourceSysdigUserRead, DeleteContext: resourceSysdigUserDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(timeout), diff --git a/sysdig/resource_sysdig_user_test.go b/sysdig/resource_sysdig_user_test.go index 581e458d..8b0444f7 100644 --- a/sysdig/resource_sysdig_user_test.go +++ b/sysdig/resource_sysdig_user_test.go @@ -39,6 +39,11 @@ func TestAccUser(t *testing.T) { { Config: userMinimumConfiguration(), }, + { + ResourceName: "sysdig_user.sample", + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/website/docs/r/sysdig_monitor_alert_anomaly.md b/website/docs/r/sysdig_monitor_alert_anomaly.md index 1393a22f..277ce289 100644 --- a/website/docs/r/sysdig_monitor_alert_anomaly.md +++ b/website/docs/r/sysdig_monitor_alert_anomaly.md @@ -70,3 +70,11 @@ alerts in Sysdig Monitor: * `version` - Current version of the resource in Sysdig Monitor. * `team` - Team ID that owns the alert. + +## Import + +Anomaly Monitor alerts can be imported using the alert ID, e.g. + +``` +$ terraform import sysdig_monitor_alert_anomaly.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_alert_downtime.md b/website/docs/r/sysdig_monitor_alert_downtime.md index 0cb9f607..3ef0ba74 100644 --- a/website/docs/r/sysdig_monitor_alert_downtime.md +++ b/website/docs/r/sysdig_monitor_alert_downtime.md @@ -65,4 +65,13 @@ In addition to all arguments above, the following attributes are exported, which alerts in Sysdig Monitor: * `version` - Current version of the resource in Sysdig Monitor. -* `team` - Team ID that owns the alert. \ No newline at end of file +* `team` - Team ID that owns the alert. + + +## Import + +Downtime Monitor alerts can be imported using the alert ID, e.g. + +``` +$ terraform import sysdig_monitor_alert_downtime.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_alert_event.md b/website/docs/r/sysdig_monitor_alert_event.md index 55a1ad57..68d6b81b 100644 --- a/website/docs/r/sysdig_monitor_alert_event.md +++ b/website/docs/r/sysdig_monitor_alert_event.md @@ -74,4 +74,13 @@ In addition to all arguments above, the following attributes are exported, which alerts in Sysdig Monitor: * `version` - Current version of the resource in Sysdig Monitor. -* `team` - Team ID that owns the alert. \ No newline at end of file +* `team` - Team ID that owns the alert. + + +## Import + +Event Monitor alerts can be imported using the alert ID, e.g. + +``` +$ terraform import sysdig_monitor_alert_event.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_alert_group_outlier.md b/website/docs/r/sysdig_monitor_alert_group_outlier.md index e1fcf96a..7f38ff97 100644 --- a/website/docs/r/sysdig_monitor_alert_group_outlier.md +++ b/website/docs/r/sysdig_monitor_alert_group_outlier.md @@ -68,4 +68,13 @@ In addition to all arguments above, the following attributes are exported, which alerts in Sysdig Monitor: * `version` - Current version of the resource in Sysdig Monitor. -* `team` - Team ID that owns the alert. \ No newline at end of file +* `team` - Team ID that owns the alert. + + +## Import + +Group Outlier Monitor alerts can be imported using the alert ID, e.g. + +``` +$ terraform import sysdig_monitor_alert_group_outlier.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_alert_metric.md b/website/docs/r/sysdig_monitor_alert_metric.md index 198330da..ef25e210 100644 --- a/website/docs/r/sysdig_monitor_alert_metric.md +++ b/website/docs/r/sysdig_monitor_alert_metric.md @@ -73,4 +73,13 @@ In addition to all arguments above, the following attributes are exported, which alerts in Sysdig Monitor: * `version` - Current version of the resource in Sysdig Monitor. -* `team` - Team ID that owns the alert. \ No newline at end of file +* `team` - Team ID that owns the alert. + + +## Import + +Metric Monitor alerts can be imported using the alert ID, e.g. + +``` +$ terraform import sysdig_monitor_alert_metric.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_dashboard.md b/website/docs/r/sysdig_monitor_dashboard.md index 3c3052cb..28a78551 100644 --- a/website/docs/r/sysdig_monitor_dashboard.md +++ b/website/docs/r/sysdig_monitor_dashboard.md @@ -112,3 +112,11 @@ In addition to all arguments above, the following attributes are exported: * `public_token` - (Computed) Token defined when the dashboard is set Public. * `version` - (Computed) The current version of the Dashboard. + +## Import + +Monitor dashboards can be imported using the dashboard ID, e.g. + +``` +$ terraform import sysdig_monitor_dashboard.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_notification_channel_email.md b/website/docs/r/sysdig_monitor_notification_channel_email.md index 4d7ac7c2..9721722c 100644 --- a/website/docs/r/sysdig_monitor_notification_channel_email.md +++ b/website/docs/r/sysdig_monitor_notification_channel_email.md @@ -42,3 +42,11 @@ resource "sysdig_monitor_notification_channel_email" "sample_email" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Email notification channels for Monitor can be imported using the ID, e.g. + +``` +$ terraform import sysdig_monitor_notification_channel_email.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_notification_channel_opsgenie.md b/website/docs/r/sysdig_monitor_notification_channel_opsgenie.md index a593fc5a..3d9d967a 100644 --- a/website/docs/r/sysdig_monitor_notification_channel_opsgenie.md +++ b/website/docs/r/sysdig_monitor_notification_channel_opsgenie.md @@ -40,3 +40,11 @@ resource "sysdig_monitor_notification_channel_opsgenie" "sample-opsgenie" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Opsgenie notification channels for Monitor can be imported using the ID, e.g. + +``` +$ terraform import sysdig_monitor_notification_channel_opsgenie.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_notification_channel_pagerduty.md b/website/docs/r/sysdig_monitor_notification_channel_pagerduty.md index 41f7c39f..f3ae4dc1 100644 --- a/website/docs/r/sysdig_monitor_notification_channel_pagerduty.md +++ b/website/docs/r/sysdig_monitor_notification_channel_pagerduty.md @@ -47,3 +47,11 @@ resource "sysdig_monitor_notification_channel_pagerduty" "sample-pagerduty" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Pagerduty notification channels for Monitor can be imported using the ID, e.g. + +``` +$ terraform import sysdig_monitor_notification_channel_pagerduty.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_notification_channel_slack.md b/website/docs/r/sysdig_monitor_notification_channel_slack.md index cfabfe49..99fe3db9 100644 --- a/website/docs/r/sysdig_monitor_notification_channel_slack.md +++ b/website/docs/r/sysdig_monitor_notification_channel_slack.md @@ -43,3 +43,11 @@ resource "sysdig_monitor_notification_channel_slack" "sample-slack" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Slack notification channels for Monitor can be imported using the ID, e.g. + +``` +$ terraform import sysdig_monitor_notification_channel_slack.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_notification_channel_sns.md b/website/docs/r/sysdig_monitor_notification_channel_sns.md index fe196203..26ef9c64 100644 --- a/website/docs/r/sysdig_monitor_notification_channel_sns.md +++ b/website/docs/r/sysdig_monitor_notification_channel_sns.md @@ -41,3 +41,11 @@ resource "sysdig_monitor_notification_channel_sns" "sample-amazon-sns" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Amazon SNS notification channels for Monitor can be imported using the ID, e.g. + +``` +$ terraform import sysdig_monitor_notification_channel_sns.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_notification_channel_victorops.md b/website/docs/r/sysdig_monitor_notification_channel_victorops.md index a950a204..c6a5d192 100644 --- a/website/docs/r/sysdig_monitor_notification_channel_victorops.md +++ b/website/docs/r/sysdig_monitor_notification_channel_victorops.md @@ -44,3 +44,11 @@ resource "sysdig_monitor_notification_channel_victorops" "sample-victorops" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +VictorOPS notification channels for Monitor can be imported using the ID, e.g. + +``` +$ terraform import sysdig_monitor_notification_channel_victorops.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_notification_channel_webhook.md b/website/docs/r/sysdig_monitor_notification_channel_webhook.md index 3d050bbb..62d2cef6 100644 --- a/website/docs/r/sysdig_monitor_notification_channel_webhook.md +++ b/website/docs/r/sysdig_monitor_notification_channel_webhook.md @@ -41,3 +41,11 @@ resource "sysdig_monitor_notification_channel_webhook" "sample-webhook" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Webhook notification channels for Monitor can be imported using the ID, e.g. + +``` +$ terraform import sysdig_monitor_notification_channel_webhook.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_monitor_team.md b/website/docs/r/sysdig_monitor_team.md index a49fec6d..90a1e961 100644 --- a/website/docs/r/sysdig_monitor_team.md +++ b/website/docs/r/sysdig_monitor_team.md @@ -81,3 +81,11 @@ data "sysdig_current_user" "me" { * `role` - (Optional) The role for the user in this group. Valid roles are: ROLE_TEAM_STANDARD, ROLE_TEAM_EDIT, ROLE_TEAM_READ, ROLE_TEAM_MANAGER. Default: ROLE_TEAM_STANDARD. + +## Import + +Monitor Teams can be imported using the ID, e.g. + +``` +$ terraform import sysdig_monitor_team.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_list.md b/website/docs/r/sysdig_secure_list.md index 155ceb8f..79734d95 100644 --- a/website/docs/r/sysdig_secure_list.md +++ b/website/docs/r/sysdig_secure_list.md @@ -32,3 +32,11 @@ resource "sysdig_secure_list" "allowed_dev_files" { * `append` - (Optional) Adds these elements to an existing list. Used to extend existing lists provided by Sysdig. The rules can only be extended once, for example if there is an existing list called "foo", one can have another append rule called "foo" but not a second one. By default this is false. + +## Import + +Secure lists can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_list.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_macro.md b/website/docs/r/sysdig_secure_macro.md index 294e3a97..97fe4437 100644 --- a/website/docs/r/sysdig_secure_macro.md +++ b/website/docs/r/sysdig_secure_macro.md @@ -36,3 +36,11 @@ resource "sysdig_secure_macro" "https_port" { * `append` - (Optional) Adds these elements to an existing macro. Used to extend existing macros provided by Sysdig. The macros can only be extended once, for example if there is an existing macro called "foo", one can have another append macro called "foo" but not a second one. By default this is false. + +## Import + +Secure macros can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_macro.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_notification_channel_email.md b/website/docs/r/sysdig_secure_notification_channel_email.md index 97abd180..21f630c8 100644 --- a/website/docs/r/sysdig_secure_notification_channel_email.md +++ b/website/docs/r/sysdig_secure_notification_channel_email.md @@ -42,3 +42,11 @@ resource "sysdig_secure_notification_channel_email" "sample_email" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Email notification channels for Secure can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_notification_channel_email.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_notification_channel_opsgenie.md b/website/docs/r/sysdig_secure_notification_channel_opsgenie.md index 9d4ee7e8..bb036387 100644 --- a/website/docs/r/sysdig_secure_notification_channel_opsgenie.md +++ b/website/docs/r/sysdig_secure_notification_channel_opsgenie.md @@ -40,3 +40,11 @@ resource "sysdig_secure_notification_channel_opsgenie" "sample-opsgenie" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Opsgenie notification channels for Secure can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_notification_channel_opsgenie.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_notification_channel_pagerduty.md b/website/docs/r/sysdig_secure_notification_channel_pagerduty.md index b923f2b7..8a50f55c 100644 --- a/website/docs/r/sysdig_secure_notification_channel_pagerduty.md +++ b/website/docs/r/sysdig_secure_notification_channel_pagerduty.md @@ -47,3 +47,11 @@ resource "sysdig_secure_notification_channel_pagerduty" "sample-pagerduty" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Pagerduty notification channels for Secure can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_notification_channel_pagerduty.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_notification_channel_slack.md b/website/docs/r/sysdig_secure_notification_channel_slack.md index b4ee9fd8..ad26d3ca 100644 --- a/website/docs/r/sysdig_secure_notification_channel_slack.md +++ b/website/docs/r/sysdig_secure_notification_channel_slack.md @@ -43,3 +43,11 @@ resource "sysdig_secure_notification_channel_slack" "sample-slack" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Slack notification channels for Secure can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_notification_channel_slack.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_notification_channel_sns.md b/website/docs/r/sysdig_secure_notification_channel_sns.md index dad776db..544b5c4c 100644 --- a/website/docs/r/sysdig_secure_notification_channel_sns.md +++ b/website/docs/r/sysdig_secure_notification_channel_sns.md @@ -41,3 +41,11 @@ resource "sysdig_secure_notification_channel_sns" "sample-amazon-sns" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +SNS notification channels for Secure can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_notification_channel_sns.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_notification_channel_victorops.md b/website/docs/r/sysdig_secure_notification_channel_victorops.md index aad7867e..f3b49066 100644 --- a/website/docs/r/sysdig_secure_notification_channel_victorops.md +++ b/website/docs/r/sysdig_secure_notification_channel_victorops.md @@ -44,3 +44,11 @@ resource "sysdig_secure_notification_channel_victorops" "sample-victorops" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +VictorOPS notification channels for Secure can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_notification_channel_victorops.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_notification_channel_webhook.md b/website/docs/r/sysdig_secure_notification_channel_webhook.md index ed19b0e2..45e72b9f 100644 --- a/website/docs/r/sysdig_secure_notification_channel_webhook.md +++ b/website/docs/r/sysdig_secure_notification_channel_webhook.md @@ -41,3 +41,11 @@ resource "sysdig_secure_notification_channel_webhook" "sample-webhook" { * `send_test_notification` - (Optional) Send an initial test notification to check if the notification channel is working. Default is false. + +## Import + +Webhook notification channels for Secure can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_notification_channel_webhook.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_policy.md b/website/docs/r/sysdig_secure_policy.md index f264a070..1d169f24 100644 --- a/website/docs/r/sysdig_secure_policy.md +++ b/website/docs/r/sysdig_secure_policy.md @@ -87,3 +87,11 @@ The actions block is optional and supports: * `notification_channels` - (Optional) IDs of the notification channels to send alerts to when the policy is fired. + +## Import + +Secure runtime policies can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_policy.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_rule_container.md b/website/docs/r/sysdig_secure_rule_container.md index 59c89de4..e2da59f5 100644 --- a/website/docs/r/sysdig_secure_rule_container.md +++ b/website/docs/r/sysdig_secure_rule_container.md @@ -40,4 +40,12 @@ resource "sysdig_secure_rule_container" "sample" { In addition to all arguments above, the following attributes are exported: -* `version` - Current version of the resource in Sysdig Secure. \ No newline at end of file +* `version` - Current version of the resource in Sysdig Secure. + +## Import + +Secure container runtime rules can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_rule_container.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_rule_falco.md b/website/docs/r/sysdig_secure_rule_falco.md index 24622b89..e4a8c199 100644 --- a/website/docs/r/sysdig_secure_rule_falco.md +++ b/website/docs/r/sysdig_secure_rule_falco.md @@ -50,4 +50,12 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: -* `version` - Current version of the resource in Sysdig Secure. \ No newline at end of file +* `version` - Current version of the resource in Sysdig Secure. + +## Import + +Secure Falco runtime rules can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_rule_falco.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_rule_filesystem.md b/website/docs/r/sysdig_secure_rule_filesystem.md index e7ee8886..fac72fd6 100644 --- a/website/docs/r/sysdig_secure_rule_filesystem.md +++ b/website/docs/r/sysdig_secure_rule_filesystem.md @@ -55,4 +55,12 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: -* `version` - Current version of the resource in Sysdig Secure. \ No newline at end of file +* `version` - Current version of the resource in Sysdig Secure. + +## Import + +Secure filesystem runtime rules can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_rule_filesystem.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_rule_network.md b/website/docs/r/sysdig_secure_rule_network.md index a5e6b62f..272e1d68 100644 --- a/website/docs/r/sysdig_secure_rule_network.md +++ b/website/docs/r/sysdig_secure_rule_network.md @@ -63,4 +63,12 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: -* `version` - Current version of the resource in Sysdig Secure. \ No newline at end of file +* `version` - Current version of the resource in Sysdig Secure. + +## Import + +Secure network runtime rules can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_rule_network.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_rule_process.md b/website/docs/r/sysdig_secure_rule_process.md index 408ad2f9..b8e4b494 100644 --- a/website/docs/r/sysdig_secure_rule_process.md +++ b/website/docs/r/sysdig_secure_rule_process.md @@ -40,4 +40,12 @@ resource "sysdig_secure_rule_process" "sample" { In addition to all arguments above, the following attributes are exported: -* `version` - Current version of the resource in Sysdig Secure. \ No newline at end of file +* `version` - Current version of the resource in Sysdig Secure. + +## Import + +Secure process runtime rules can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_rule_process.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_rule_syscall.md b/website/docs/r/sysdig_secure_rule_syscall.md index af28d94f..bbb3d3ba 100644 --- a/website/docs/r/sysdig_secure_rule_syscall.md +++ b/website/docs/r/sysdig_secure_rule_syscall.md @@ -39,4 +39,12 @@ resource "sysdig_secure_rule_syscall" "foo" { In addition to all arguments above, the following attributes are exported: -* `version` - Current version of the resource in Sysdig Secure. \ No newline at end of file +* `version` - Current version of the resource in Sysdig Secure. + +## Import + +Secure syscall runtime rules can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_rule_syscall.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_secure_team.md b/website/docs/r/sysdig_secure_team.md index f2487160..004c7d13 100644 --- a/website/docs/r/sysdig_secure_team.md +++ b/website/docs/r/sysdig_secure_team.md @@ -64,4 +64,12 @@ data "sysdig_current_user" "me" { * `role` - (Optional) The role for the user in this group. Valid roles are: ROLE_TEAM_STANDARD, ROLE_TEAM_EDIT, ROLE_TEAM_READ, ROLE_TEAM_MANAGER. - Default: ROLE_TEAM_STANDARD. \ No newline at end of file + Default: ROLE_TEAM_STANDARD. + +## Import + +Secure Teams can be imported using the ID, e.g. + +``` +$ terraform import sysdig_secure_team.example 12345 +``` \ No newline at end of file diff --git a/website/docs/r/sysdig_user.md b/website/docs/r/sysdig_user.md index 6ba56d8f..b9e9f884 100644 --- a/website/docs/r/sysdig_user.md +++ b/website/docs/r/sysdig_user.md @@ -32,4 +32,13 @@ resource "sysdig_user" "foo-bar" { * `first_name` - (Optional) The name of the user. -* `last_name` - (Optional) The last name of the user. \ No newline at end of file +* `last_name` - (Optional) The last name of the user. + + +## Import + +Sysdig users can be imported using the ID, e.g. + +``` +$ terraform import sysdig_user.example 12345 +``` \ No newline at end of file