I am trying to convert Cloudformation code to Terraform. The YAML file which I have is for the SageMaker project, provided by AWS. I want to create a CodeCommit repository in Terraform for ModelBuild and ModelDeploy. I am able to create the repository in Terraform using the below syntax
resource "aws_codecommit_repository" "test" {
repository_name = "MyTestRepository"
description = "This is the Sample App Repository"
}
This creates an empty repo. Though when my repo is getting created, at the same time I want to add all necessary files in it from an S3 bucket(seed code provided 开发者_如何学Goby AWS)
This is what I have done till now. For reference purposes the CodeCommit repository in Cloudformation is done using
ModelBuildCodeCommitRepository:
Type: AWS::CodeCommit::Repository
Properties:
# Max allowed length: 100 chars
RepositoryName: !Sub sagemaker-${SageMakerProjectName}-${SageMakerProjectId}-modelbuild # max: 10+33+15+10=68
RepositoryDescription: !Sub SageMaker Model building workflow infrastructure as code for the Project ${SageMakerProjectName}
Code:
S3:
Bucket: sagemaker-servicecatalog-seedcode-eu-west-2
Key: toolchain/image-build-model-building-workflow-v1.0.zip
BranchName: main
And So far I have defined this in Terraform using
resource "aws_codecommit_repository" "model_build_code_commit_repository" {
repository_name = "sagemaker-${var.sage_maker_project_name}-${var.sage_maker_project_id}-modelbuild"
description = "SageMaker Model building workflow infrastructure as code for the Project ${var.sage_maker_project_name}"
default_branch = var.repo_default_branch
}
As you can see in Clodformation yaml I want to load the data from S3 bucket in my repo. I went through their documentation, though was not able to find any solution for this.
精彩评论