Deploy and Apply the Terraform Stack
In this step, you deploy the Terraform stack either from the Oracle Marketplace or from its GitHub repository and then apply it to the desired environment.
Deploy the Terraform Stack
To start the scenario, you first need to deploy the Terraform stack. You can do so either from the Marketplace apps or from GitHub.
Deploy the Stack from Marketplace Apps
To deploy the Terraform stack from the Marketplace apps, use this procedure:
- Log in to Oracle Cloud.
- From the hamburger menu, select Marketplace then Marketplace (again) to view all available apps.
- Enter search keywords Logging Analytics to find the Autonomous Transaction Processing (ATP) Database Audit Logs Monitoring app.
- Select Stack Version then Compartment.
- Review the Oracle standard Terms and Restrictions and then check I have reviewed and accept.
- Click Launch Stack.
- Finally, follow the steps outlined in "Applying Stack by using the Resource Manager", below.
Deploy the Stack from Github
From GitHub, you can either do a quick deploy or deploy by using source code.
Perform a Quick Deploy
To deploy the stack quickly from GitHub, use this procedure.
- Go to the GitHub repository at https://github.com/oracle-quickstart/oci-management-agent.
- Click Deploy to Oracle Cloud in the
README.md
section of the page. - Check I have reviewed and accept the Oracle Terms of Use and then Next.
- Finally, follow the steps in "Apply the Terraform Stack", below.
Apply the Terraform Stack
Applying the stack creates the compute instance, enables the Management Agent, installs plugins, creates entity associations, and starts capturing logs.
Configure Stack Information
To configure stack information, use this procedure.
- Confirm the Stack Information is correctly displayed.
- In Name, enter a unique stack deployment identifier.
- Optionally, you can add a description that accurately describes this stack deployment.
- Open Create in compartment and select a compartment.
- Optionally specify any namespace tags to organize and track any resources.
- Click Next to advance to the Configure Variables screen.
Configure Variables
Next, you need to configure variables by specifying the Autonomous Database for Transaction Processing details, then Compute instance details, and finally setting the Management Agent IAM policies.
Enter the Autonomous Database for Transaction Processing Details
To enter the Autonomous Database for Transaction Processing details, use this procedure.
- From Select ATP Compartment, select the appropriate ATP compartment.
- From Select the ATP database to monitor, choose the appropriate database.
- Enter your ATP username in ATP Username.
- Open Select Vault Compartment, and locate the compartment where the Vault Secret resides
- From Vault Secret, select the appropriate secret.
- Open Database Service Name and select the appropriate service name from the drop-down list.
- Populate Logging Analytics Log Group OCID.
Enter Compute Instance Details
To enter the compute instance details, use this procedure.
- Enter a unique Instance name to identify the compute instance.
- Open the Availability domain dropdown and select a domain.
- Open Instance shape and select a shape compatible with OEL7
- Select existing VCN from the dropdown list (refer to "Meet the Prerequisites for Implementing this Use Case", above for details).
- Select the existing Subnet from the dropdown (refer to "Meet the Prerequisites for Implementing this Use Case", above for details).
- Provide an SSH public key so you can access the compute instance.
Review Entries
Now, review all information entered in the previous screens. Leave Run Apply unchecked at this time and click Create to finish creating the Stack
Apply the Stack
Now, apply the stack. This is a three-step process in which you'll validate your entries, then actually apply the stack, and, finally, destroy any service components created in the apply phase so you can revert any changes if you need to reapply the stack.
Plan the Operation
Run the planning phase as a validation step to ensure there are no issues when applying the stack. You should run the plan and verify the logs before applying the stack.
- Click Plan to create the Plan job.
- Provide a name to uniquely identify the Plan job.
- Click Plan to run the plan job.
- Review the Logs section on the same screen to ensure no problems were identified.
- Select Stack Details from the breadcrumb menu.
- Verify in the Jobs section that the plan state reads Succeeded.
Apply the Stack
Apply the stack to create the compute instance, enable the Management Agent, install plugins, create entity associations, and start capturing logs.
- Press Apply to begin creating the Apply job
- Enter a name that uniquely identifies the Apply job.
- Keep Apply Job Plan Resolution to automatically approve the apply job.
- Click Apply to execute the apply job.
- Review the Logs section on the same screen to ensure no problems were identified.
- Verify in the Job Information section the apply job state reads Succeeded.
- Under Resources, click Outputs to see the execution output information.
- Click the Application Information tab to access links to the newly created resources.
Destroy Service Components
You will typically destroy service components when you want to revert failed changes and clean up the environment before reapplying the stack.
Note:
Destroy does not delete Logging Analytics Entity and Management Agent from UI. To delete these resources, find the OCID in the output section of a stack job, search in the RQS section of the console, and go to the corresponding resource page. To delete the Logging Analytics entity, first remove the associated sources and then delete the entity.- On the Stack Details page, click Destroy to destroy resources created by the Apply job earlier earlier in this process.
- Enter a name that uniquely identifies the Destroy job.
- Click Destroy to execute the destroy job.
- Review the information in the Logs section to ensure all resources were destroyed.
- In the Job Information section, verify that the destroy job state reads Succeeded.