Associate CodeCommit repo While creating Sagemaker notebook Instance - aws-cloudformation

I am trying to create Sagemaker notebook instance using cloudformation template. Just wanted to see if there is any way i can associate codecommit repo to that note book instance.
I know simple way to create repo and associate it using sagemaker via GUI easily.. However, is there any way we can associate via template.
I found similar info on https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html But it doesn't show with cloudformation

SageMaker now supports associating code repository including CodeCommit and any other Git repository with Notebook Instances via CloudFormation.
Here's the link for more information: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-coderepository.html

Related

Programmatically Connecting a GitHub repo to a Google Cloud Project

I'm working on a Terraform project that will set up all the GCP resources needed for a large project spanning multiple GitHub repos. My goal is to be able to recreate the cloud infrastructure from scratch completely with Terraform.
The issue I'm running into is in order to setup build triggers with Terraform within GCP, the GitHub repo that is setting off the trigger first needs to be connected. Currently, I've only been able to do that manually via the Google Cloud Build dashboard. I'm not sure if this is possible via Terraform or with a script but I'm looking for any solution I can automate this with. Once the projects are connected updating everything with Terraform is working fine.
TLDR; How can I programmatically connect a GitHub project with a GCP project instead of using the dashboard?
Currently there is no way to programmatically connect a GitHub repo to a Google Cloud Project. This must be done manually via Google Cloud.
My workaround is to manually connect an "admin" project, build containers and save them to that project's artifact registry, and then deploy the containers from the registry in the programmatically generated project.

Is there a way to Create CodeSpace using CLI or API

For now I can able to create CodeSpace using option available in GitHub UI as shown in the below screenshot.
Create CodeSpace Option
Is there any option to automate the CodeSpace creation flow like CLI (or) API, from which I can create CodeSpace?
You can create Codespaces via both the CLI and API:
https://cli.github.com/manual/gh_codespace_create
https://docs.github.com/en/rest/reference/codespaces#create-a-codespace-for-the-authenticated-user

GitHub Pages Automation

Overview:
I'm using GitHub Pages feature to host documentation. I'm working on a CI/CD process to automate the build so that when the source for the documentation is updated it automatically rebuilds the content and deploys to GitHub Pages.
Details:
So far, using AWS CodeBuild, I've implemented the following:
Pulls down source from GitHub Repo
Uses MkDocs to build and deploy to the special gh-pages branch using the "mkdocs gh-deploy" command.
This is done with command lines in the CodeBuild Buildspec. The reason I'm using commands is that I want to use GitHub Deploy Keys opposed to creating user account (used as a machine account) that my team would need to manage.
I have it all working except what triggers the build. If the process was using a user account to authenticate then I can use AWS CodePipeline which creates a Webhook within the GitHub repo, and then notifications are sent via the Webhook to say that the master branch was updated, which would trigger a new build.
I'd like to implement a similar process but using the GitHub repo's Deploy Key. Any suggestions?

Clearity on github structure for terraform template

I am trying to understand the readymade template for IBM Cloud at https://cam-proxy-ng.ng.bluemix.net/cam/instances/#!/deployTemplateEditorWithNoParam/7921d773a240309379cf2c31c8004c9a
which is Node.js on a Single VM.
When we go to the source code at git referred in this template https://github.com/camc-experimental/terraform-modules/blob/master/ibmcloud/virtual_guest/ there is a createVirtualGuest.tf file. I am trying to understand why the create virtual guest is on GIT and not on the .tf template on bluemix console? Why there are 2 files which as code for creation of virtual guest?
This has to do with the structure of a Terraform template. You can define fragments of a resource orchestration in so-called modules, which are stored as separate files, and then refer to them from within the template.
The way the CAM service currently works, you can only work on the master template within the service. Modules that are referenced cannot be edited in the service and are pulled in from Github.
This is not ideal, and it should allow browsing and editing modules, too, but that function is currently not supported.

Provisioning GitHub-backed CodePipeline using CloudFormation

I am trying to create my CodePipeline using CloudFormation. The problem I'm having is that once it's created and tries to run, it immediately gives me the error:
Invalid action configuration The GitHub repository "MyOrg/MyRepo" or
branch "MyBranch" does not exist.
When in fact they both do. I can click on Edit, select my source control, Connect to GitHub, then select that exact repository and branch, and it works fine. But when starting the pipeline directly following the CloudFormation provisioning of the pipeline, it always gives me this error.
I did an export of the pipeline configuration JSON using aws codepipeline get-pipeline of a freshly provisioned pipeline using CloudFormation, and then did so again immediately after updating the configuration in the console using "Connect to GitHub" and both are identical.
Make sure that the Configuration property for your CodePipeline's GitHub Source Action contains all four required properties as listed in the documentation:
Owner
Repo
Branch
OAuthToken
Double check that your provided values are correct, particularly OAuthToken, which approximates the "Connect To GitHub" step in the the AWS Console-based CodePipeline setup.
To get a valid OAuthToken from GitHub to enter here, you need to create a New personal access token with repo and admin:repo_hook scopes enabled, as described in the documentation troubleshooting page.