Help us shape the future of Go! Take the 2026 Go Developer Survey

servicecatalog

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the cloudmock implementation of the AWS servicecatalog service.

func New

func New(accountID, region string) *Service

New returns a new servicecatalog Service.

func (*Service) Actions

func (s *Service) Actions() []service.Action

Actions returns all supported API actions.

func (*Service) HandleRequest

func (s *Service) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes a request to the appropriate handler.

func (*Service) HealthCheck

func (s *Service) HealthCheck() error

HealthCheck always returns nil.

func (*Service) Name

func (s *Service) Name() string

Name returns the AWS service name used for request routing.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is the in-memory data store for AWS Service Catalog.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates an empty Store.

func (*Store) AcceptPortfolioShare

func (s *Store) AcceptPortfolioShare(portfolioID, shareType string) *service.AWSError

AcceptPortfolioShare marks a share as accepted.

func (*Store) AssociateBudget

func (s *Store) AssociateBudget(budgetName, resourceID string) *service.AWSError

AssociateBudget links a budget name to a resource.

func (*Store) AssociatePrincipal

func (s *Store) AssociatePrincipal(portfolioID, arn, principalType string) *service.AWSError

AssociatePrincipal associates a principal ARN with a portfolio.

func (*Store) AssociateProductWithPortfolio

func (s *Store) AssociateProductWithPortfolio(portfolioID, productID string) *service.AWSError

AssociateProductWithPortfolio links a product to a portfolio.

func (*Store) AssociateServiceActionWithArtifact

func (s *Store) AssociateServiceActionWithArtifact(productID, artifactID, serviceActionID string) *service.AWSError

AssociateServiceActionWithArtifact links a service action to a (product, artifact).

func (*Store) AssociateTagOption

func (s *Store) AssociateTagOption(resourceID, tagOptionID string) *service.AWSError

AssociateTagOption associates a tag option with a resource.

func (*Store) CreateConstraint

func (s *Store) CreateConstraint(portfolioID, productID, constraintType, parameters, description string) (*StoredConstraint, *service.AWSError)

CreateConstraint inserts a new constraint.

func (*Store) CreatePlan

func (s *Store) CreatePlan(name, planType, productID, pathID, artifactID, ppName string, params []map[string]any, notifications []string, tags map[string]string) (*StoredPlan, *service.AWSError)

CreatePlan inserts a new provisioned product plan.

func (*Store) CreatePortfolio

func (s *Store) CreatePortfolio(displayName, description, providerName string, tags map[string]string) (*StoredPortfolio, *service.AWSError)

CreatePortfolio inserts a new portfolio.

func (*Store) CreatePortfolioShare

func (s *Store) CreatePortfolioShare(portfolioID, accountID, shareType string, sharePrincipals, shareTagOptions bool) (string, *service.AWSError)

CreatePortfolioShare records a portfolio share.

func (*Store) CreateProduct

func (s *Store) CreateProduct(name, owner, description, distributor, productType, supportDescription, supportEmail, supportUrl string, tags map[string]string, artifactName, artifactDescription, artifactType string, info map[string]string) (*StoredProduct, *StoredProvisioningArtifact, *service.AWSError)

CreateProduct inserts a new product (and its initial provisioning artifact, if provided).

func (*Store) CreateProvisioningArtifact

func (s *Store) CreateProvisioningArtifact(productID, name, description, paType string, info map[string]string) (*StoredProvisioningArtifact, *service.AWSError)

CreateProvisioningArtifact inserts a new artifact for a product.

func (*Store) CreateServiceAction

func (s *Store) CreateServiceAction(name, defType string, definition map[string]string, description string) (*StoredServiceAction, *service.AWSError)

CreateServiceAction inserts a new service action.

func (*Store) CreateTagOption

func (s *Store) CreateTagOption(key, value string) (*StoredTagOption, *service.AWSError)

CreateTagOption inserts a new tag option.

func (*Store) DeleteConstraint

func (s *Store) DeleteConstraint(id string) *service.AWSError

DeleteConstraint removes a constraint.

func (*Store) DeletePlan

func (s *Store) DeletePlan(id string) *service.AWSError

DeletePlan removes a plan.

func (*Store) DeletePortfolio

func (s *Store) DeletePortfolio(id string) *service.AWSError

DeletePortfolio removes a portfolio and all of its associations.

func (*Store) DeletePortfolioShare

func (s *Store) DeletePortfolioShare(portfolioID, accountID, shareType string) (string, *service.AWSError)

DeletePortfolioShare removes a share.

func (*Store) DeleteProduct

func (s *Store) DeleteProduct(id string) *service.AWSError

DeleteProduct removes a product and all of its artifacts.

func (*Store) DeleteProvisioningArtifact

func (s *Store) DeleteProvisioningArtifact(productID, artifactID string) *service.AWSError

DeleteProvisioningArtifact removes an artifact.

func (*Store) DeleteServiceAction

func (s *Store) DeleteServiceAction(id string) *service.AWSError

DeleteServiceAction removes a service action.

func (*Store) DeleteTagOption

func (s *Store) DeleteTagOption(id string) *service.AWSError

DeleteTagOption removes a tag option.

func (*Store) DisassociateBudget

func (s *Store) DisassociateBudget(budgetName, resourceID string) *service.AWSError

DisassociateBudget unlinks a budget from a resource.

func (*Store) DisassociatePrincipal

func (s *Store) DisassociatePrincipal(portfolioID, arn string) *service.AWSError

DisassociatePrincipal removes a principal from a portfolio.

func (*Store) DisassociateProductFromPortfolio

func (s *Store) DisassociateProductFromPortfolio(portfolioID, productID string) *service.AWSError

DisassociateProductFromPortfolio removes the link.

func (*Store) DisassociateServiceActionFromArtifact

func (s *Store) DisassociateServiceActionFromArtifact(productID, artifactID, serviceActionID string) *service.AWSError

DisassociateServiceActionFromArtifact removes the association.

func (*Store) DisassociateTagOption

func (s *Store) DisassociateTagOption(resourceID, tagOptionID string) *service.AWSError

DisassociateTagOption removes the association between a tag option and a resource.

func (*Store) ExecutePlan

func (s *Store) ExecutePlan(id string) *service.AWSError

ExecutePlan moves a plan into EXECUTE_SUCCESS.

func (*Store) GetAWSOrganizationsAccess

func (s *Store) GetAWSOrganizationsAccess() string

GetAWSOrganizationsAccess returns the current Organizations status.

func (*Store) GetConstraint

func (s *Store) GetConstraint(id string) (*StoredConstraint, *service.AWSError)

GetConstraint returns a constraint by id.

func (*Store) GetCopyOperation

func (s *Store) GetCopyOperation(token string) (*StoredCopyOperation, *service.AWSError)

GetCopyOperation returns a copy operation by token.

func (*Store) GetPlan

func (s *Store) GetPlan(id string) (*StoredPlan, *service.AWSError)

GetPlan returns a plan by id.

func (*Store) GetPortfolio

func (s *Store) GetPortfolio(id string) (*StoredPortfolio, *service.AWSError)

GetPortfolio returns a portfolio by id.

func (*Store) GetProduct

func (s *Store) GetProduct(id string) (*StoredProduct, *service.AWSError)

GetProduct returns a product by id.

func (*Store) GetProductByName

func (s *Store) GetProductByName(name string) (*StoredProduct, *service.AWSError)

GetProductByName returns a product by display name.

func (*Store) GetProvisionedProduct

func (s *Store) GetProvisionedProduct(idOrName string) (*StoredProvisionedProduct, *service.AWSError)

GetProvisionedProduct fetches a provisioned product by id or name.

func (*Store) GetProvisioningArtifact

func (s *Store) GetProvisioningArtifact(productID, artifactID string) (*StoredProvisioningArtifact, *service.AWSError)

GetProvisioningArtifact returns an artifact by id.

func (*Store) GetRecord

func (s *Store) GetRecord(id string) (*StoredRecord, *service.AWSError)

GetRecord returns a record by id.

func (*Store) GetServiceAction

func (s *Store) GetServiceAction(id string) (*StoredServiceAction, *service.AWSError)

GetServiceAction returns a service action by id.

func (*Store) GetTagOption

func (s *Store) GetTagOption(id string) (*StoredTagOption, *service.AWSError)

GetTagOption returns a tag option by id.

func (*Store) ListArtifactsForServiceAction

func (s *Store) ListArtifactsForServiceAction(serviceActionID string) []*StoredProvisioningArtifact

ListArtifactsForServiceAction returns the (product, artifact) pairs linked to a service action.

func (*Store) ListBudgetsForResource

func (s *Store) ListBudgetsForResource(resourceID string) []string

ListBudgetsForResource returns all budgets associated with a resource.

func (*Store) ListConstraintsForPortfolio

func (s *Store) ListConstraintsForPortfolio(portfolioID, productID string) []*StoredConstraint

ListConstraintsForPortfolio returns all constraints in a portfolio.

func (*Store) ListPlans

func (s *Store) ListPlans(provisionedProductName string) []*StoredPlan

ListPlans returns all plans, optionally filtered by provisioned-product name.

func (*Store) ListPortfolioShares

func (s *Store) ListPortfolioShares(portfolioID, shareType string) []*StoredPortfolioShare

ListPortfolioShares returns shares for a portfolio.

func (*Store) ListPortfolios

func (s *Store) ListPortfolios() []*StoredPortfolio

ListPortfolios returns all portfolios.

func (*Store) ListPortfoliosForProduct

func (s *Store) ListPortfoliosForProduct(productID string) []*StoredPortfolio

ListPortfoliosForProduct returns the portfolios that contain a product.

func (*Store) ListPrincipals

func (s *Store) ListPrincipals(portfolioID string) []*StoredPrincipal

ListPrincipals returns all principals for a portfolio.

func (*Store) ListProducts

func (s *Store) ListProducts() []*StoredProduct

ListProducts returns all products.

func (*Store) ListProductsForPortfolio

func (s *Store) ListProductsForPortfolio(portfolioID string) []*StoredProduct

ListProductsForPortfolio returns the products linked to a portfolio.

func (*Store) ListProvisionedProducts

func (s *Store) ListProvisionedProducts() []*StoredProvisionedProduct

ListProvisionedProducts returns all provisioned products.

func (*Store) ListProvisioningArtifacts

func (s *Store) ListProvisioningArtifacts(productID string) ([]*StoredProvisioningArtifact, *service.AWSError)

ListProvisioningArtifacts returns all artifacts for a product.

func (*Store) ListRecords

func (s *Store) ListRecords(provisionedProductID, provisionedProductName string) []*StoredRecord

ListRecords returns records, optionally filtered by provisioned-product id/name.

func (*Store) ListResourcesForTagOption

func (s *Store) ListResourcesForTagOption(tagOptionID string) []string

ListResourcesForTagOption returns all resources associated with a tag option.

func (*Store) ListServiceActions

func (s *Store) ListServiceActions() []*StoredServiceAction

ListServiceActions returns all service actions.

func (*Store) ListServiceActionsForArtifact

func (s *Store) ListServiceActionsForArtifact(productID, artifactID string) []*StoredServiceAction

ListServiceActionsForArtifact returns service actions linked to a (product, artifact).

func (*Store) ListTagOptions

func (s *Store) ListTagOptions(filterKey, filterValue string, active *bool) []*StoredTagOption

ListTagOptions returns all tag options that match the optional filters.

func (*Store) ProvisionProduct

func (s *Store) ProvisionProduct(name, productID, artifactID, pathID, idempotencyToken string, tags map[string]string, userArn string) (*StoredProvisionedProduct, *StoredRecord, *service.AWSError)

ProvisionProduct creates a new provisioned product and a PROVISION record.

func (*Store) RejectPortfolioShare

func (s *Store) RejectPortfolioShare(portfolioID, shareType string) *service.AWSError

RejectPortfolioShare removes shares of the given type.

func (*Store) Reset

func (s *Store) Reset()

Reset clears all in-memory state.

func (*Store) SetAWSOrganizationsAccess

func (s *Store) SetAWSOrganizationsAccess(status string)

SetAWSOrganizationsAccess updates the AWS Organizations access flag.

func (*Store) SetProvisionedProductOutputs

func (s *Store) SetProvisionedProductOutputs(idOrName string, outputs []map[string]any) *service.AWSError

SetProvisionedProductOutputs replaces the outputs slice (for tests/notification).

func (*Store) StartCopyProduct

func (s *Store) StartCopyProduct(sourceArn, targetID string) string

StartCopyProduct registers an in-flight copy operation and returns its token.

func (*Store) TerminateProvisionedProduct

func (s *Store) TerminateProvisionedProduct(idOrName string) (*StoredRecord, *service.AWSError)

TerminateProvisionedProduct creates a TERMINATE record and removes the provisioned product.

func (*Store) UpdateConstraint

func (s *Store) UpdateConstraint(id string, description, parameters *string) (*StoredConstraint, *service.AWSError)

UpdateConstraint updates fields on a constraint.

func (*Store) UpdatePortfolio

func (s *Store) UpdatePortfolio(id string, displayName, description, providerName *string, addTags map[string]string, removeTagKeys []string) (*StoredPortfolio, *service.AWSError)

UpdatePortfolio updates fields on a portfolio.

func (*Store) UpdatePortfolioShare

func (s *Store) UpdatePortfolioShare(portfolioID, accountID, shareType string, sharePrincipals, shareTagOptions *bool) (string, *service.AWSError)

UpdatePortfolioShare updates a share's flags.

func (*Store) UpdateProduct

func (s *Store) UpdateProduct(id string, name, owner, description, distributor, supportDescription, supportEmail, supportUrl *string, addTags map[string]string, removeTagKeys []string) (*StoredProduct, *service.AWSError)

UpdateProduct updates fields on a product.

func (*Store) UpdateProvisionedProduct

func (s *Store) UpdateProvisionedProduct(idOrName, productID, artifactID, pathID string, tags map[string]string) (*StoredProvisionedProduct, *StoredRecord, *service.AWSError)

UpdateProvisionedProduct creates an UPDATE record and updates the provisioned product.

func (*Store) UpdateProvisionedProductProperties

func (s *Store) UpdateProvisionedProductProperties(id string, props map[string]any) (*StoredProvisionedProduct, string, *service.AWSError)

UpdateProvisionedProductProperties updates ad-hoc properties on a provisioned product.

func (*Store) UpdateProvisioningArtifact

func (s *Store) UpdateProvisioningArtifact(productID, artifactID string, name, description, guidance *string, active *bool) (*StoredProvisioningArtifact, *service.AWSError)

UpdateProvisioningArtifact updates fields on an artifact.

func (*Store) UpdateServiceAction

func (s *Store) UpdateServiceAction(id string, name, description *string, definition map[string]string) (*StoredServiceAction, *service.AWSError)

UpdateServiceAction updates fields on a service action.

func (*Store) UpdateTagOption

func (s *Store) UpdateTagOption(id string, value *string, active *bool) (*StoredTagOption, *service.AWSError)

UpdateTagOption updates fields on a tag option.

type StoredConstraint

type StoredConstraint struct {
	Id          string
	Type        string // LAUNCH, NOTIFICATION, TEMPLATE, STACKSET, RESOURCE_UPDATE
	Description string
	Parameters  string
	PortfolioId string
	ProductId   string
	Status      string // AVAILABLE, CREATING, FAILED
	Owner       string
}

StoredConstraint is a persisted launch/notification/etc. constraint.

type StoredCopyOperation

type StoredCopyOperation struct {
	Token            string
	SourceProductArn string
	TargetProductId  string
	Status           string // SUCCEEDED, IN_PROGRESS, FAILED
	StatusDetail     string
}

StoredCopyOperation tracks a CopyProduct in-flight token.

type StoredPlan

type StoredPlan struct {
	Id                     string
	Name                   string
	Type                   string // CLOUDFORMATION, TERRAFORMCLOUD
	ProductId              string
	PathId                 string
	ProvisioningArtifactId string
	NotificationArns       []string
	ProvisionedProductName string
	ProvisioningParameters []map[string]any
	Tags                   map[string]string
	StatusMessage          string
	Status                 string // CREATE_IN_PROGRESS, CREATE_SUCCESS, CREATE_FAILED, EXECUTE_IN_PROGRESS, EXECUTE_SUCCESS, EXECUTE_FAILED
	UpdatedTime            time.Time
	CreatedTime            time.Time
}

StoredPlan is a persisted provisioned product plan.

type StoredPortfolio

type StoredPortfolio struct {
	Id           string
	Arn          string
	DisplayName  string
	Description  string
	ProviderName string
	CreatedTime  time.Time
	Tags         map[string]string
}

StoredPortfolio is a persisted portfolio.

type StoredPortfolioShare

type StoredPortfolioShare struct {
	PortfolioId     string
	AccountId       string
	Type            string // ACCOUNT, ORGANIZATION, ORGANIZATIONAL_UNIT, ORGANIZATION_MEMBER_ACCOUNT
	Accepted        bool
	SharePrincipals bool
	ShareTagOptions bool
	Token           string
	Status          string // NOT_STARTED, IN_PROGRESS, COMPLETED, COMPLETED_WITH_ERRORS, ERROR
}

StoredPortfolioShare is a persisted portfolio share.

type StoredPrincipal

type StoredPrincipal struct {
	PortfolioId   string
	PrincipalARN  string
	PrincipalType string // IAM, IAM_PATTERN
}

StoredPrincipal is an IAM/IAM_PATTERN principal granted access to a portfolio.

type StoredProduct

type StoredProduct struct {
	Id                 string
	Arn                string
	Name               string
	Owner              string
	Distributor        string
	Description        string
	ShortDescription   string
	Type               string // CLOUD_FORMATION_TEMPLATE, MARKETPLACE, TERRAFORM_OPEN_SOURCE
	CreatedTime        time.Time
	Status             string // CREATED, AVAILABLE, FAILED
	Tags               map[string]string
	SupportDescription string
	SupportEmail       string
	SupportUrl         string
}

StoredProduct is a persisted product (top-level catalog entry).

type StoredProvisionedProduct

type StoredProvisionedProduct struct {
	Id                       string
	Name                     string
	Type                     string // CFN_STACK, CFN_STACKSET, TERRAFORM_OPEN_SOURCE
	Arn                      string
	Status                   string // AVAILABLE, UNDER_CHANGE, TAINTED, ERROR, PLAN_IN_PROGRESS
	StatusMessage            string
	CreatedTime              time.Time
	LastRecordId             string
	ProductId                string
	ProductName              string
	ProvisioningArtifactId   string
	ProvisioningArtifactName string
	UserArn                  string
	UserArnSession           string
	Tags                     map[string]string
	LaunchRoleArn            string
	IdempotencyToken         string
	Outputs                  []map[string]any
}

StoredProvisionedProduct is a persisted provisioned product instance.

type StoredProvisioningArtifact

type StoredProvisioningArtifact struct {
	Id          string
	ProductId   string
	Name        string
	Description string
	Type        string
	CreatedTime time.Time
	Active      bool
	Guidance    string // DEFAULT, DEPRECATED
	Info        map[string]string
}

StoredProvisioningArtifact represents a provisioning artifact (a version of a product template).

type StoredRecord

type StoredRecord struct {
	Id                     string
	ProvisionedProductName string
	ProvisionedProductType string
	RecordType             string // PROVISION_PRODUCT, UPDATE_PROVISIONED_PRODUCT, TERMINATE_PROVISIONED_PRODUCT
	ProvisionedProductId   string
	Status                 string // CREATED, IN_PROGRESS, IN_PROGRESS_IN_ERROR, SUCCEEDED, FAILED
	CreatedTime            time.Time
	UpdatedTime            time.Time
	ProductId              string
	ProvisioningArtifactId string
	PathId                 string
	RecordErrors           []map[string]any
	RecordTags             map[string]string
}

StoredRecord is a persisted record (provision/update/terminate operation).

type StoredServiceAction

type StoredServiceAction struct {
	Id             string
	Name           string
	DefinitionType string // SSM_AUTOMATION
	Definition     map[string]string
	Description    string
}

StoredServiceAction is a persisted Service Catalog service action.

type StoredTagOption

type StoredTagOption struct {
	Id     string
	Key    string
	Value  string
	Active bool
	Owner  string
}

StoredTagOption is a persisted tag option.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL