Skip to content

Commit cede6b2

Browse files
committed
fix markdown weirdness and actually get the CTA
1 parent 63657b8 commit cede6b2

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

_source/_posts/2025-01-09-terraform-powershell-lab.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can follow these steps on any computer where you're able to install the foll
3232
- Install [Terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli).
3333
- Create an Okta org by [signing up](/signup/) for Workforce Identity Cloud.
3434

35-
Note: Free trial accounts expire after 30 days, but developer accounts do not expire.
35+
**Note:** Free trial accounts expire after 30 days, but developer accounts do not expire.
3636

3737
To use Terraform, you'll run commands in a terminal. You can even use a PowerShell window if you don't have a favorite terminal!
3838

@@ -83,14 +83,13 @@ You will save a private key alongside your code to simplify the lab. In producti
8383

8484
e. Under "Private Key - Copy this!" select PEM.
8585

86-
**Note**: the PEM key begins with the line `-----BEGIN PRIVATE KEY-----`.
87-
Make sure you're looking at the PEM, not the JSON.
86+
**Note**: the PEM key begins with the line `-----BEGIN PRIVATE KEY-----`. Make sure you're looking at the PEM, not the JSON.
8887

8988
f. Select Copy to clipboard.
9089

9190
4. On your computer, paste the key into a file and save it as `key.pem`
9291

93-
**Important:** The key is saved locally to simplify the lab. You should save the key to an appropriate secrets management solution when working with production environments. If you do not have secrets management, [this blog post](/blog/2024/10/11/terraform-ci-cd) shares one way to set it up.
92+
**Important:** The key is saved locally to simplify the lab. You should save the key to an appropriate secrets management solution when working with production environments. If you do not have secrets management, [this blog post](/blog/2024/10/11/terraform-ci-cd) shares one way to set it up.
9493

9594
5. Complete the configuration steps.
9695

@@ -175,7 +174,7 @@ An Okta Ice intern uses PowerShell to generate a newsletter with statistics abou
175174
You can access PowerShell 7 by launching it from the shortcut generated during its installation or with the Visual Studio Code built-in terminal.
176175
177176
## Configure a PowerShell Application using Terraform
178-
1. Add the following to your main.tf file:
177+
1. Add the following to your `main.tf` file:
179178
180179
```hcl
181180
resource "okta_app_oauth" "ps" {
@@ -204,11 +203,12 @@ resource "okta_app_oauth_api_scope" "ps-scopes" {
204203
3. Type `yes` when prompted.
205204
4. Wait for the `terraform apply` to complete.
206205
5. From the `Creation complete after` output, copy the value of the `okta_app_oauth` id.
207-
**Note:** PowerShell and Terraform now have separate applications in your Okta organization.
208-
The PowerShell application's ID can also be found in the Okta admin console under Applications -> Applications.
206+
207+
**Note:** PowerShell and Terraform now have separate applications in your Okta organization. The PowerShell application's ID can also be found in the Okta admin console under Applications -> Applications.
208+
209209
6. In PowerShell, run these commands:
210-
**Note:** Replace the {yourOktaDomain} with the entire domain for your Okta org. For example,
211-
oktaice0000000.oktapreview.com. Replace the ID with the value you copied above.
210+
211+
**Note:** Replace the {yourOktaDomain} with the entire domain for your Okta org. For example, `oktaice0000000.oktapreview.com`. Replace the ID with the value you copied above.
212212

213213
```
214214
$Configuration = Get-OktaConfiguration
@@ -225,11 +225,6 @@ resource "okta_app_oauth_api_scope" "ps-scopes" {
225225
## Extra Credit
226226
You have set up the PowerShell application with various scopes. What interesting information about your organization can you retrieve using these scopes? Will these scopes allow you to make any changes to the Okta organization? Try some PowerShell commands to create or destroy resources and see what happens!
227227

228-
If you want to explore your Okta org more with PowerShell, these resources may help:
229-
- Okta Developer [PowerShell blog post](/blog/2024/05/07/okta-powershell-module)
230-
- Okta Developer Podcast [PowerShell Episode](/blog/2024/04/11/okta-powershell-module-podcast)
231-
- The Okta PowerShell module [test suite](https://github.com/okta/okta-powershell-cli/blob/main/tests/Api/OktaGroupApi.Tests.ps1)
232-
233228
## Manage Terraform using Terraform
234229

235230
Now, we'll use data gathered by Powershell to improve your Terraform configuration.
@@ -242,8 +237,7 @@ Your manager at Okta Ice assigns you a ticket to update the configuration of the
242237

243238
## Manage Terraform in Terraform
244239

245-
1) In your PowerShell session from the previous section, run the command `powershell
246-
Invoke-OktaListApplications`
240+
1) In your PowerShell session from the previous section, run the command `powershell Invoke-OktaListApplications`
247241

248242
2) In the resulting list, find the ID of your Terraform app. Note that the name you chose, such as "Terraform lab," will be shown in the label field.
249243

@@ -358,5 +352,13 @@ resource "okta_app_oauth" "tf" {
358352
}
359353
```
360354

355+
## Conclusion
356+
357+
If you want to explore your Okta org more with PowerShell, these resources may help:
358+
- Okta Developer [PowerShell blog post](/blog/2024/05/07/okta-powershell-module)
359+
- Okta Developer Podcast [PowerShell Episode](/blog/2024/04/11/okta-powershell-module-podcast)
360+
- The Okta PowerShell module [test suite](https://github.com/okta/okta-powershell-cli/blob/main/tests/Api/OktaGroupApi.Tests.ps1)
361+
362+
Remember to follow us on [Twitter](https://twitter.com/oktadev) and subscribe to our [YouTube channel](https://www.youtube.com/c/OktaDev/) for more exciting content. We also want to hear from you about topics you want to see and questions you may have. Leave us a comment below!
361363

362364

0 commit comments

Comments
 (0)