generated from oracle-devrel/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
devops.tf
54 lines (43 loc) · 1.38 KB
/
devops.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## Copyright (c) 2023, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
# Create log and log group
resource "oci_logging_log_group" "test_log_group" {
compartment_id = var.compartment_ocid
display_name = "devops-log-group_${random_string.id.result}"
}
resource "oci_logging_log" "test_log" {
#Required
display_name = "${var.prefix}-devops-log"
log_group_id = oci_logging_log_group.test_log_group.id
log_type = "SERVICE"
#Optional
configuration {
#Required
source {
#Required
category = "all"
resource = oci_devops_project.test_project.id
service = "devops"
source_type = "OCISERVICE"
}
#Optional
compartment_id = var.compartment_ocid
}
is_enabled = true
retention_duration = "30"
}
# Create OCI Notification
resource "oci_ons_notification_topic" "test_notification_topic" {
compartment_id = var.compartment_ocid
name = "${var.prefix}-devops-topic-${random_string.id.result}"
}
# Create devops project
resource "oci_devops_project" "test_project" {
compartment_id = var.compartment_ocid
name = "${var.prefix}-devops"
description = "${var.prefix}-devops"
notification_config {
#Required
topic_id = oci_ons_notification_topic.test_notification_topic.id
}
}