Alright so I found the way to do it. Its a bit hacky but it did the job for me !
I first went ahead and created the Slack integration manually using the UI. Click on "EDIT NOTIFICATION CHANNEL". Once the new slack integration has been completed, I ran the following gcloud
command:
gcloud alpha monitoring channels list --project <PROJECT>
This will return
...
displayName: Prod Slack Alerts
enabled: true
labels:
auth_token: '****************************************************GdjG'
channel_name: '#slack_channel'
name: projects/<PROJECCT>/notificationChannels/<CHANNEL-ID>
type: slack
...
This gives you an idea that it ends with GdjG
. Your token can end differently. You will need to find this using you web browser's Inspector. I will be using GdjG
as an example.
Now go back and create the slack notification manually again but this time, open the Web browser's Inspector and search for GdjG
. Once you are done with all the flow you should see something like this:

So look for URLs like
Request URL: https://slack.com/api/auth.test?token=
:path: /api/auth.test?token=
You can now go ahead and create your slack channel using Terraform by using the token. In my experience, the token does not change if you are trying to integrate with the same slack organization.